diff --git a/Cargo.lock b/Cargo.lock index e9bb87058..333a1056b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -634,7 +634,6 @@ name = "nac3ast" version = "0.1.0" dependencies = [ "fxhash", - "lazy_static", "parking_lot", "string-interner", ] diff --git a/nac3ast/Cargo.toml b/nac3ast/Cargo.toml index 2c78fb423..dc2bd5582 100644 --- a/nac3ast/Cargo.toml +++ b/nac3ast/Cargo.toml @@ -10,7 +10,6 @@ constant-optimization = ["fold"] fold = [] [dependencies] -lazy_static = "1.5" parking_lot = "0.12" string-interner = "0.17" fxhash = "0.2" diff --git a/nac3ast/src/ast_gen.rs b/nac3ast/src/ast_gen.rs index a1a62726c..d23717dc3 100644 --- a/nac3ast/src/ast_gen.rs +++ b/nac3ast/src/ast_gen.rs @@ -5,14 +5,12 @@ pub use crate::location::Location; use fxhash::FxBuildHasher; use parking_lot::{Mutex, MutexGuard}; -use std::{cell::RefCell, collections::HashMap, fmt}; +use std::{cell::RefCell, collections::HashMap, fmt, sync::LazyLock}; use string_interner::{symbol::SymbolU32, DefaultBackend, StringInterner}; pub type Interner = StringInterner; -lazy_static! { - static ref INTERNER: Mutex = - Mutex::new(StringInterner::with_hasher(FxBuildHasher::default())); -} +static INTERNER: LazyLock> = + LazyLock::new(|| Mutex::new(StringInterner::with_hasher(FxBuildHasher::default()))); thread_local! { static LOCAL_INTERNER: RefCell> = RefCell::default(); diff --git a/nac3ast/src/lib.rs b/nac3ast/src/lib.rs index 0bd1dd910..51c703f8d 100644 --- a/nac3ast/src/lib.rs +++ b/nac3ast/src/lib.rs @@ -14,9 +14,6 @@ clippy::wildcard_imports )] -#[macro_use] -extern crate lazy_static; - mod ast_gen; mod constant; #[cfg(feature = "fold")]