diff --git a/Cargo.lock b/Cargo.lock index 4a4413905a40e..f50d12548a3b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2817,7 +2817,6 @@ dependencies = [ "k256", "log", "macro_magic", - "once_cell", "parity-scale-codec", "paste", "pretty_assertions", @@ -9542,7 +9541,6 @@ dependencies = [ "cfg-if", "libc", "log", - "once_cell", "parity-scale-codec", "paste", "rustix 0.36.14", @@ -10226,7 +10224,6 @@ dependencies = [ "lazy_static", "libc", "log", - "once_cell", "parking_lot 0.12.1", "regex", "rustc-hash", diff --git a/client/executor/wasmtime/Cargo.toml b/client/executor/wasmtime/Cargo.toml index cdfd54f2694c9..3e669e7c9e701 100644 --- a/client/executor/wasmtime/Cargo.toml +++ b/client/executor/wasmtime/Cargo.toml @@ -39,7 +39,6 @@ sp-wasm-interface = { version = "14.0.0", path = "../../../primitives/wasm-inter # this doesn't have any actual benefits for us besides making it harder to debug memory # problems (since then `mmap` etc. cannot be easily hooked into). rustix = { version = "0.36.7", default-features = false, features = ["std", "mm", "fs", "param", "use-libc"] } -once_cell = "1.12.0" [dev-dependencies] wat = "1.0" diff --git a/client/executor/wasmtime/src/util.rs b/client/executor/wasmtime/src/util.rs index 5c64fc01c13a8..c38d969ce9dcd 100644 --- a/client/executor/wasmtime/src/util.rs +++ b/client/executor/wasmtime/src/util.rs @@ -144,8 +144,8 @@ pub(crate) fn replace_strategy_if_broken(strategy: &mut InstantiationStrategy) { InstantiationStrategy::LegacyInstanceReuse => InstantiationStrategy::RecreateInstance, }; - use once_cell::sync::OnceCell; - static IS_OK: OnceCell = OnceCell::new(); + use std::sync::OnceLock; + static IS_OK: OnceLock = OnceLock::new(); let is_ok = IS_OK.get_or_init(|| { let is_ok = match is_madvise_working() { diff --git a/client/tracing/Cargo.toml b/client/tracing/Cargo.toml index 5ffb0d80ef185..07a8a2ef0f1ae 100644 --- a/client/tracing/Cargo.toml +++ b/client/tracing/Cargo.toml @@ -19,7 +19,6 @@ chrono = "0.4.19" lazy_static = "1.4.0" libc = "0.2.121" log = { version = "0.4.17" } -once_cell = "1.8.0" parking_lot = "0.12.1" regex = "1.6.0" rustc-hash = "1.1.0" diff --git a/client/tracing/src/logging/directives.rs b/client/tracing/src/logging/directives.rs index 3985bf2d88c64..f1caf1a13a2de 100644 --- a/client/tracing/src/logging/directives.rs +++ b/client/tracing/src/logging/directives.rs @@ -14,18 +14,18 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -use once_cell::sync::OnceCell; use parking_lot::Mutex; +use std::sync::OnceLock; use tracing_subscriber::{ filter::Directive, fmt as tracing_fmt, layer, reload::Handle, EnvFilter, Registry, }; // Handle to reload the tracing log filter -static FILTER_RELOAD_HANDLE: OnceCell> = OnceCell::new(); +static FILTER_RELOAD_HANDLE: OnceLock> = OnceLock::new(); // Directives that are defaulted to when resetting the log filter -static DEFAULT_DIRECTIVES: OnceCell>> = OnceCell::new(); +static DEFAULT_DIRECTIVES: OnceLock>> = OnceLock::new(); // Current state of log filter -static CURRENT_DIRECTIVES: OnceCell>> = OnceCell::new(); +static CURRENT_DIRECTIVES: OnceLock>> = OnceLock::new(); /// Add log filter directive(s) to the defaults /// diff --git a/frame/support/Cargo.toml b/frame/support/Cargo.toml index 4eebcfa4f3766..6fbb0a026ed96 100644 --- a/frame/support/Cargo.toml +++ b/frame/support/Cargo.toml @@ -32,7 +32,6 @@ tt-call = "1.0.8" macro_magic = "0.4.1" frame-support-procedural = { version = "4.0.0-dev", default-features = false, path = "./procedural" } paste = "1.0" -once_cell = { version = "1", default-features = false, optional = true } sp-state-machine = { version = "0.28.0", default-features = false, optional = true, path = "../../primitives/state-machine" } bitflags = "1.3" impl-trait-for-tuples = "0.2.2" @@ -53,7 +52,6 @@ default = ["std"] std = [ "sp-core/std", "k256/std", - "once_cell", "serde/std", "sp-api/std", "sp-io/std", diff --git a/frame/support/procedural/src/storage/metadata.rs b/frame/support/procedural/src/storage/metadata.rs index 5561d0564597b..37cd806192982 100644 --- a/frame/support/procedural/src/storage/metadata.rs +++ b/frame/support/procedural/src/storage/metadata.rs @@ -114,8 +114,8 @@ fn default_byte_getter( #[cfg(feature = "std")] #[allow(non_upper_case_globals)] - static #cache_name: #scrate::once_cell::sync::OnceCell<#scrate::sp_std::vec::Vec> = - #scrate::once_cell::sync::OnceCell::new(); + static #cache_name: ::core::sync::OnceLock<#scrate::sp_std::vec::Vec> = + ::core::sync::OnceLock::new(); #[cfg(feature = "std")] impl<#runtime_generic: #runtime_trait, #optional_instance_bound> diff --git a/frame/support/src/lib.rs b/frame/support/src/lib.rs index 0f2b135eed323..8d021045ed675 100644 --- a/frame/support/src/lib.rs +++ b/frame/support/src/lib.rs @@ -41,9 +41,6 @@ pub use codec; pub use frame_metadata as metadata; #[doc(hidden)] pub use log; -#[cfg(feature = "std")] -#[doc(hidden)] -pub use once_cell; #[doc(hidden)] pub use paste; #[doc(hidden)]