Compare commits

..

3 commits

Author SHA1 Message Date
bc03fd73a0
0.4.9
Some checks failed
Rust / build (push) Has been cancelled
2025-06-22 03:11:45 +03:00
f20f1e33eb
chore: bump dependencies 2025-06-22 03:04:40 +03:00
61d4b7377f
colors: remove lazy_static dependency and use LazyLock for COLORS 2025-06-22 02:53:21 +03:00
3 changed files with 22 additions and 42 deletions

46
Cargo.lock generated
View file

@ -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"
@ -236,12 +225,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"
@ -262,10 +245,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "microfetch"
version = "0.4.8"
version = "0.4.9"
dependencies = [
"criterion",
"lazy_static",
"libc",
"nix",
]

View file

@ -1,6 +1,6 @@
[package]
name = "microfetch"
version = "0.4.8"
version = "0.4.9"
edition = "2024"
[lib]
@ -13,11 +13,10 @@ path = "src/main.rs"
[dependencies]
nix = { version = "0.30", features = ["fs", "hostname", "feature"] }
lazy_static = "1.5"
libc = "0.2"
[dev-dependencies]
criterion = "0.5"
criterion = "0.6"
[[bench]]
name = "benchmark"

View file

@ -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 = {
pub static COLORS: LazyLock<Colors> = 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!(