diff --git a/Cargo.toml b/Cargo.toml index c563c631..9020dbf2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,6 @@ either = "1.6.1" libc = "0.2.155" bitflags = "2.3.1" log = "0.4.20" -once_cell = "1.19.0" per-thread-mutex = "0.1.4" serde_json = "1.0.0" diff --git a/src/lib.rs b/src/lib.rs index b3bdc865..f5df7a5f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,8 +38,6 @@ mod status; mod tests; mod wipe; -use once_cell::sync::Lazy; - #[cfg(cryptsetup23supported)] pub use crate::mem::{SafeBorrowedMemZero, SafeMemzero, SafeOwnedMemZero}; pub use crate::{ @@ -78,11 +76,12 @@ pub use libc::{c_int, c_uint, size_t}; pub type Result = std::result::Result; #[cfg(feature = "mutex")] -static MUTEX: Lazy = - Lazy::new(per_thread_mutex::PerThreadMutex::default); +static MUTEX: std::sync::LazyLock = + std::sync::LazyLock::new(per_thread_mutex::PerThreadMutex::default); #[cfg(not(feature = "mutex"))] -static THREAD_ID: Lazy = Lazy::new(|| std::thread::current().id()); +static THREAD_ID: std::sync::LazyLock = + std::sync::LazyLock::new(|| std::thread::current().id()); #[cfg(test)] mod test {