Skip to content

Commit

Permalink
Remove the dependency on lazy_static in favour of buildt-in `LazyLo…
Browse files Browse the repository at this point in the history
…ck` (#755)
  • Loading branch information
jessebraham authored Feb 10, 2025
1 parent c73ea4d commit ad1cb9f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions espflash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ esp-idf-part = "0.5.0"
flate2 = "1.0.35"
hex = { version = "0.4.3", features = ["serde"] }
indicatif = { version = "0.17.9", optional = true }
lazy_static = { version = "1.5.0", optional = true }
log = "0.4.22"
md-5 = "0.10.6"
miette = "7.4.0"
Expand Down Expand Up @@ -74,7 +73,6 @@ cli = [
"dep:directories",
"dep:env_logger",
"dep:indicatif",
"dep:lazy_static",
"dep:parse_int",
"dep:toml",
"dep:update-informer",
Expand Down
13 changes: 5 additions & 8 deletions espflash/src/cli/monitor/parser/mod.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
pub mod esp_defmt;
pub mod serial;

use std::{borrow::Cow, io::Write};
use std::{borrow::Cow, io::Write, sync::LazyLock};

use crossterm::{
style::{Color, Print, PrintStyledContent, Stylize},
QueueableCommand,
};
use lazy_static::lazy_static;
use regex::Regex;

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

pub mod esp_defmt;
pub mod serial;

pub trait InputParser {
fn feed(&mut self, bytes: &[u8], out: &mut dyn Write);
}

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

fn resolve_addresses(
symbols: &Symbols<'_>,
Expand Down

0 comments on commit ad1cb9f

Please sign in to comment.