From 61d4b7377fcd87a3174bc14582e7188aaeb54cc0 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 22 Jun 2025 02:53:21 +0300 Subject: [PATCH 1/3] colors: remove lazy_static dependency and use LazyLock for COLORS --- Cargo.lock | 7 ------- Cargo.toml | 1 - src/colors.rs | 13 ++++++------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e65dced..c3d8d07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -236,12 +236,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - [[package]] name = "libc" version = "0.2.171" @@ -265,7 +259,6 @@ name = "microfetch" version = "0.4.8" dependencies = [ "criterion", - "lazy_static", "libc", "nix", ] diff --git a/Cargo.toml b/Cargo.toml index f598dce..2662682 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,6 @@ path = "src/main.rs" [dependencies] nix = { version = "0.30", features = ["fs", "hostname", "feature"] } -lazy_static = "1.5" libc = "0.2" [dev-dependencies] diff --git a/src/colors.rs b/src/colors.rs index 11a4b9f..da613a5 100644 --- a/src/colors.rs +++ b/src/colors.rs @@ -1,4 +1,5 @@ use std::env; +use std::sync::LazyLock; pub struct Colors { pub reset: &'static str, @@ -36,13 +37,11 @@ impl Colors { } } -lazy_static::lazy_static! { - pub static ref COLORS: Colors = { - // check for NO_COLOR once at startup - let is_no_color = env::var("NO_COLOR").is_ok(); - Colors::new(is_no_color) - }; -} +pub static COLORS: LazyLock = LazyLock::new(|| { + // check for NO_COLOR once at startup + let is_no_color = env::var("NO_COLOR").is_ok(); + Colors::new(is_no_color) +}); pub fn print_dots() -> String { format!( From f20f1e33eb8948b5613138ad2440b71f2fdcfc99 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 22 Jun 2025 03:04:40 +0300 Subject: [PATCH 2/3] chore: bump dependencies --- Cargo.lock | 37 +++++++++++++------------------------ Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c3d8d07..6081b21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -113,25 +113,22 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "criterion" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +checksum = "3bf7af66b0989381bd0be551bd7cc91912a655a58c6918420c9527b1fd8b4679" dependencies = [ "anes", "cast", "ciborium", "clap", "criterion-plot", - "is-terminal", - "itertools", + "itertools 0.13.0", "num-traits", - "once_cell", "oorandom", "plotters", "rayon", "regex", "serde", - "serde_derive", "serde_json", "tinytemplate", "walkdir", @@ -144,7 +141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools", + "itertools 0.10.5", ] [[package]] @@ -194,23 +191,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hermit-abi" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" - -[[package]] -name = "is-terminal" -version = "0.4.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys", -] - [[package]] name = "itertools" version = "0.10.5" @@ -220,6 +200,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.15" diff --git a/Cargo.toml b/Cargo.toml index 2662682..3af3192 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ nix = { version = "0.30", features = ["fs", "hostname", "feature"] } libc = "0.2" [dev-dependencies] -criterion = "0.5" +criterion = "0.6" [[bench]] name = "benchmark" From bc03fd73a0010c46f379e5d3b510b415bc4273b4 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 22 Jun 2025 03:11:45 +0300 Subject: [PATCH 3/3] 0.4.9 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6081b21..c6cfc69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -245,7 +245,7 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "microfetch" -version = "0.4.8" +version = "0.4.9" dependencies = [ "criterion", "libc", diff --git a/Cargo.toml b/Cargo.toml index 3af3192..f20ff00 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "microfetch" -version = "0.4.8" +version = "0.4.9" edition = "2024" [lib]