Skip to content

Commit db965ff

Browse files
authored
Merge pull request #75 from mulkieran/issue_project_833
Use std::sync::LazyLock instead of once_cell::Lazy
2 parents 5cba75e + faaa504 commit db965ff

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ bindgen = "0.72.0"
2929
[dev-dependencies]
3030
glob = "0.3.0"
3131
gpt = "3.0.0"
32-
once_cell = "1.19.0"
3332
serde = { version = "1.0.130", features = ["derive"] }
3433
serde_json = "1.0.68"
3534
tempfile = "3.4.0"

tests/util/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
use libc::fallocate;
2-
use once_cell::sync::Lazy;
32
use serde::{Deserialize, Deserializer};
43
use std::{
54
fs::OpenOptions,
65
io,
76
os::unix::io::AsRawFd,
87
path::Path,
98
process::Command,
9+
sync::LazyLock,
1010
sync::{Arc, Mutex, MutexGuard},
1111
};
1212

1313
use tempfile::{NamedTempFile, TempPath};
1414

1515
// All tests use the same loopback device interface and so can tread on each others toes leading to
1616
// racy tests. So we need to lock all tests to ensure only one runs at a time.
17-
static LOCK: Lazy<Arc<Mutex<()>>> = Lazy::new(|| Arc::new(Mutex::new(())));
17+
static LOCK: LazyLock<Arc<Mutex<()>>> = LazyLock::new(|| Arc::new(Mutex::new(())));
1818

1919
pub fn create_backing_file(size: i64) -> TempPath {
2020
let file = NamedTempFile::new().expect("should be able to create a temp file");

0 commit comments

Comments
 (0)