Skip to content

Commit 95e3cc6

Browse files
committed
Replace once_cell::sync::OnceCell with std::sync::OnceLock
1 parent fca0bd1 commit 95e3cc6

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

Cargo.lock

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ hashbrown = { version = "0.15.2", default-features = false }
2727
serde = { version = "1.0.217", optional = true, features = ["derive"] }
2828
cfg-if = "1.0.0"
2929
rayon = { version = "1.10.0", optional = true }
30-
once_cell = "1.20.3"
3130
arbitrary = { version = "1.4.1", optional = true }
3231
crossbeam-utils = "0.8"
3332
typesize = { version = "0.1.11", default-features = false, optional = true }

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ use lock::{RwLockReadGuardDetached, RwLockWriteGuardDetached};
4141
pub use mapref::entry::{Entry, OccupiedEntry, VacantEntry};
4242
use mapref::multiple::RefMulti;
4343
use mapref::one::{Ref, RefMut};
44-
use once_cell::sync::OnceCell;
4544
pub use read_only::ReadOnlyView;
4645
pub use set::DashSet;
4746
use std::collections::hash_map::RandomState;
47+
use std::sync::OnceLock;
4848
use try_result::TryResult;
4949

5050
pub(crate) type HashMap<K, V> = hash_table::HashTable<(K, V)>;
@@ -58,7 +58,7 @@ pub(crate) type HashMap<K, V> = hash_table::HashTable<(K, V)>;
5858
pub struct TryReserveError {}
5959

6060
fn default_shard_amount() -> usize {
61-
static DEFAULT_SHARD_AMOUNT: OnceCell<usize> = OnceCell::new();
61+
static DEFAULT_SHARD_AMOUNT: OnceLock<usize> = OnceLock::new();
6262
*DEFAULT_SHARD_AMOUNT.get_or_init(|| {
6363
(std::thread::available_parallelism().map_or(1, usize::from) * 4).next_power_of_two()
6464
})

0 commit comments

Comments
 (0)