diff --git a/Cargo.toml b/Cargo.toml index 6a33421..85e6550 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,6 @@ bindgen = "0.72.0" [dev-dependencies] glob = "0.3.0" gpt = "3.0.0" -once_cell = "1.19.0" serde = { version = "1.0.130", features = ["derive"] } serde_json = "1.0.68" tempfile = "3.4.0" diff --git a/tests/util/mod.rs b/tests/util/mod.rs index 98ea87f..fc3f65d 100644 --- a/tests/util/mod.rs +++ b/tests/util/mod.rs @@ -1,5 +1,4 @@ use libc::fallocate; -use once_cell::sync::Lazy; use serde::{Deserialize, Deserializer}; use std::{ fs::OpenOptions, @@ -7,6 +6,7 @@ use std::{ os::unix::io::AsRawFd, path::Path, process::Command, + sync::LazyLock, sync::{Arc, Mutex, MutexGuard}, }; @@ -14,7 +14,7 @@ use tempfile::{NamedTempFile, TempPath}; // All tests use the same loopback device interface and so can tread on each others toes leading to // racy tests. So we need to lock all tests to ensure only one runs at a time. -static LOCK: Lazy>> = Lazy::new(|| Arc::new(Mutex::new(()))); +static LOCK: LazyLock>> = LazyLock::new(|| Arc::new(Mutex::new(()))); pub fn create_backing_file(size: i64) -> TempPath { let file = NamedTempFile::new().expect("should be able to create a temp file");