Skip to content

Commit 12cc902

Browse files
committed
Remove once_cell dep by replacing once_cell::sync::OnceCell with std::sync::OnceLock
1 parent 0f81349 commit 12cc902

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ flaky_tests = []
3737
prost = ["prost-types"]
3838

3939
[dependencies]
40-
once_cell = "1.4"
4140
prost-types = { version = "0.11", default-features = false, optional = true }
4241
crossbeam-utils = "0.8.5"
4342

src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,10 @@
141141
#![allow(clippy::must_use_candidate)]
142142

143143
use crossbeam_utils::atomic::AtomicCell;
144+
use std::sync::OnceLock;
144145
use std::time::Duration;
145146
use std::{cell::RefCell, sync::Arc};
146147

147-
use once_cell::sync::OnceCell;
148-
149148
mod clocks;
150149
use self::clocks::{Counter, Monotonic};
151150
mod detection;
@@ -159,13 +158,13 @@ mod stats;
159158
use self::stats::Variance;
160159

161160
// Global clock, used by `Instant::now`.
162-
static GLOBAL_CLOCK: OnceCell<Clock> = OnceCell::new();
161+
static GLOBAL_CLOCK: OnceLock<Clock> = OnceLock::new();
163162

164163
// Global recent measurement, used by `Clock::recent` and `Instant::recent`.
165164
static GLOBAL_RECENT: AtomicCell<u64> = AtomicCell::new(0);
166165

167166
// Global calibration, shared by all clocks.
168-
static GLOBAL_CALIBRATION: OnceCell<Calibration> = OnceCell::new();
167+
static GLOBAL_CALIBRATION: OnceLock<Calibration> = OnceLock::new();
169168

170169
// Per-thread clock override, used by `quanta::with_clock`, `Instant::now`, and sometimes `Instant::recent`.
171170
thread_local! {

0 commit comments

Comments
 (0)