Skip to content

Commit f8795cf

Browse files
committed
Remove dependency on once_cell
1 parent 5fb7cae commit f8795cf

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ diff = ["dissimilar"]
2121
[dependencies]
2222
dissimilar = { version = "1.0", optional = true }
2323
glob = "0.3"
24-
once_cell = "1.9"
2524
serde = "1.0.194"
2625
serde_derive = "1.0.194"
2726
serde_json = "1.0.110"

src/flock.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
use crate::error::Result;
2-
use once_cell::sync::OnceCell;
32
use std::fs::{self, File, OpenOptions};
43
use std::io;
54
use std::path::{Path, PathBuf};
65
use std::sync::atomic::{AtomicBool, Ordering};
7-
use std::sync::{Arc, Mutex, MutexGuard, PoisonError};
6+
use std::sync::{Arc, Mutex, MutexGuard, OnceLock, PoisonError};
87
use std::thread;
98
use std::time::{Duration, SystemTime};
109

11-
static LOCK: OnceCell<Mutex<()>> = OnceCell::new();
10+
static LOCK: OnceLock<Mutex<()>> = OnceLock::new();
1211

1312
pub(crate) struct Lock {
1413
intraprocess_guard: Guard,

src/term.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
use once_cell::sync::OnceCell;
21
use std::io::{Result, Write};
3-
use std::sync::{Mutex, MutexGuard, PoisonError};
2+
use std::sync::{Mutex, MutexGuard, OnceLock, PoisonError};
43
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream as Stream, WriteColor};
54

6-
static TERM: OnceCell<Mutex<Term>> = OnceCell::new();
5+
static TERM: OnceLock<Mutex<Term>> = OnceLock::new();
76

87
pub(crate) fn lock() -> MutexGuard<'static, Term> {
98
TERM.get_or_init(|| Mutex::new(Term::new()))

0 commit comments

Comments
 (0)