diff --git a/Cargo.lock b/Cargo.lock index 02369d1afe..da8ef3a8ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4443,7 +4443,6 @@ dependencies = [ "indexmap", "log", "naga", - "once_cell", "parking_lot", "profiling", "raw-window-handle 0.6.2", diff --git a/Cargo.toml b/Cargo.toml index e9554de982..57ecf39700 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -110,8 +110,6 @@ nanorand = { version = "0.7", default-features = false, features = ["wyrand"] } noise = "0.9" nv-flip = "0.1" obj = "0.10" -# NOTE: once_cell/std is *required* for some commonly-used features, selecting this per crate -once_cell = { version = "1.20.2", default-features = false } # Firefox has 3.4.0 vendored, so we allow that version in our dependencies ordered-float = { version = ">=3,<=4.6", default-features = false } parking_lot = "0.12.1" diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index ae5a90ae17..73fe615c84 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -123,7 +123,6 @@ document-features.workspace = true hashbrown.workspace = true indexmap.workspace = true log.workspace = true -once_cell = { workspace = true, features = ["std"] } parking_lot.workspace = true profiling = { workspace = true, default-features = false } raw-window-handle = { workspace = true, optional = true } diff --git a/wgpu-core/src/pool.rs b/wgpu-core/src/pool.rs index 375b36c32e..7a3bbb85da 100644 --- a/wgpu-core/src/pool.rs +++ b/wgpu-core/src/pool.rs @@ -1,16 +1,15 @@ use std::{ hash::Hash, - sync::{Arc, Weak}, + sync::{Arc, OnceLock, Weak}, }; use hashbrown::{hash_map::Entry, HashMap}; -use once_cell::sync::OnceCell; use crate::lock::{rank, Mutex}; use crate::FastHashMap; type SlotInner = Weak; -type ResourcePoolSlot = Arc>>; +type ResourcePoolSlot = Arc>>; pub struct ResourcePool { inner: Mutex>>, @@ -52,7 +51,7 @@ impl ResourcePool { // No entry exists for this resource. // // We know that the resource is not alive, so we can create a new entry. - Entry::Vacant(entry) => Arc::clone(entry.insert(Arc::new(OnceCell::new()))), + Entry::Vacant(entry) => Arc::clone(entry.insert(Arc::new(OnceLock::new()))), }; drop(map_guard);