diff --git a/Cargo.lock b/Cargo.lock index b0ac402..78c49c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,7 +87,6 @@ dependencies = [ "blkpath", "clap", "libc", - "once_cell", "sudo", "tempfile", ] diff --git a/Cargo.toml b/Cargo.toml index 01f6504..98fe60b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,6 @@ path = "src/bin/blkreader.rs" blkpath = "0.1" blkmap = "0.1" libc = "0.2" -once_cell = "1.19" clap = { version = "4.5", features = ["derive"] } sudo = "0.6" diff --git a/src/cache.rs b/src/cache.rs index da0c6a0..3d7eea3 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -6,13 +6,12 @@ //! to the underlying block device. use blkpath::ResolveDevice; -use once_cell::sync::Lazy; use std::collections::HashMap; use std::fs::{File, OpenOptions}; use std::io; use std::os::unix::fs::{MetadataExt, OpenOptionsExt}; use std::path::PathBuf; -use std::sync::{Arc, RwLock}; +use std::sync::{Arc, LazyLock, RwLock}; /// A cached block device entry containing the path and file handle. #[derive(Debug)] @@ -39,8 +38,8 @@ impl CachedDevice { /// The cache is keyed by the device ID (from `stat.st_dev`), which /// uniquely identifies a filesystem. All files on the same filesystem /// share the same underlying block device. -static DEVICE_CACHE: Lazy>>> = - Lazy::new(|| RwLock::new(HashMap::new())); +static DEVICE_CACHE: LazyLock>>> = + LazyLock::new(|| RwLock::new(HashMap::new())); /// Get or create a cached block device entry for the given file. ///