Skip to content

Commit ad1cb9f

Browse files
authored
Remove the dependency on lazy_static in favour of buildt-in LazyLock (#755)
1 parent c73ea4d commit ad1cb9f

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

espflash/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ esp-idf-part = "0.5.0"
4040
flate2 = "1.0.35"
4141
hex = { version = "0.4.3", features = ["serde"] }
4242
indicatif = { version = "0.17.9", optional = true }
43-
lazy_static = { version = "1.5.0", optional = true }
4443
log = "0.4.22"
4544
md-5 = "0.10.6"
4645
miette = "7.4.0"
@@ -74,7 +73,6 @@ cli = [
7473
"dep:directories",
7574
"dep:env_logger",
7675
"dep:indicatif",
77-
"dep:lazy_static",
7876
"dep:parse_int",
7977
"dep:toml",
8078
"dep:update-informer",

espflash/src/cli/monitor/parser/mod.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
pub mod esp_defmt;
2-
pub mod serial;
3-
4-
use std::{borrow::Cow, io::Write};
1+
use std::{borrow::Cow, io::Write, sync::LazyLock};
52

63
use crossterm::{
74
style::{Color, Print, PrintStyledContent, Stylize},
85
QueueableCommand,
96
};
10-
use lazy_static::lazy_static;
117
use regex::Regex;
128

139
use crate::cli::monitor::{line_endings::normalized, symbols::Symbols};
1410

11+
pub mod esp_defmt;
12+
pub mod serial;
13+
1514
pub trait InputParser {
1615
fn feed(&mut self, bytes: &[u8], out: &mut dyn Write);
1716
}
1817

1918
// Pattern to much a function address in serial output.
20-
lazy_static! {
21-
static ref RE_FN_ADDR: Regex = Regex::new(r"0x[[:xdigit:]]{8}").unwrap();
22-
}
19+
static RE_FN_ADDR: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"0x[[:xdigit:]]{8}").unwrap());
2320

2421
fn resolve_addresses(
2522
symbols: &Symbols<'_>,

0 commit comments

Comments
 (0)