Skip to content

Commit 375e8af

Browse files
Drop once_cell dependency (#1740)
1 parent 7365444 commit 375e8af

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
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
@@ -101,7 +101,6 @@ v8_enable_pointer_compression = []
101101

102102
[dependencies]
103103
bitflags = "2.5"
104-
once_cell = "1.19"
105104
paste = "1.0"
106105

107106
[build-dependencies]

src/V8.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Copyright 2019-2021 the Deno authors. All rights reserved. MIT license.
2-
use once_cell::sync::Lazy;
32
use std::ffi::CStr;
43
use std::ffi::CString;
54
use std::sync::Mutex;
@@ -72,8 +71,7 @@ enum GlobalState {
7271
}
7372
use GlobalState::*;
7473

75-
static GLOBAL_STATE: Lazy<Mutex<GlobalState>> =
76-
Lazy::new(|| Mutex::new(Uninitialized));
74+
static GLOBAL_STATE: Mutex<GlobalState> = Mutex::new(Uninitialized);
7775

7876
pub fn assert_initialized() {
7977
let global_state_guard = GLOBAL_STATE.lock().unwrap();

tests/test_api.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Copyright 2019-2021 the Deno authors. All rights reserved. MIT license.
2-
use once_cell::sync::Lazy;
32
use std::any::type_name;
43
use std::borrow::Cow;
54
use std::cell::RefCell;
@@ -13,6 +12,7 @@ use std::mem::MaybeUninit;
1312
use std::os::raw::c_char;
1413
use std::ptr::{addr_of, addr_of_mut};
1514
use std::sync::Arc;
15+
use std::sync::LazyLock;
1616
use std::sync::Mutex;
1717
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
1818
use v8::AccessorConfiguration;
@@ -9598,7 +9598,8 @@ fn counter_lookup_callback() {
95989598
unsafe impl Send for Name {}
95999599
unsafe impl Send for Count {}
96009600

9601-
static MAP: Lazy<Arc<Mutex<HashMap<Name, Count>>>> = Lazy::new(Arc::default);
9601+
static MAP: LazyLock<Arc<Mutex<HashMap<Name, Count>>>> =
9602+
LazyLock::new(Arc::default);
96029603

96039604
// |name| points to a static zero-terminated C string.
96049605
extern "C" fn callback(name: *const c_char) -> *mut i32 {

0 commit comments

Comments
 (0)