Skip to content

Commit

Permalink
Replace once_cell crate with standard library's OnceLock
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 25, 2023
1 parent 4d0e1a1 commit 334f89f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ differential-dataflow = { version = "0.12", default-features = false }
fnv = "1.0.7"
minipre = "0.2"
num_cpus = "1.0"
once_cell = "1.8"
opener = "0.6"
ref-cast = "1.0"
regex = { version = "1.9.2", default-features = false, features = ["std", "perf"] }
Expand Down
4 changes: 2 additions & 2 deletions src/arena.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use fnv::FnvHashMap;
use once_cell::sync::OnceCell;
use std::any::TypeId;
use std::fmt::{self, Debug};
use std::iter::{Copied, FromIterator};
use std::slice::Iter;
use std::sync::OnceLock;
use std::sync::{Mutex, PoisonError};
use typed_arena::Arena;

Expand Down Expand Up @@ -69,7 +69,7 @@ where
return Slice::EMPTY;
}

static ARENA: OnceCell<Mutex<FnvHashMap<TypeId, Box<dyn Send>>>> = OnceCell::new();
static ARENA: OnceLock<Mutex<FnvHashMap<TypeId, Box<dyn Send>>>> = OnceLock::new();

let mut map = ARENA
.get_or_init(Mutex::default)
Expand Down

0 comments on commit 334f89f

Please sign in to comment.