diff --git a/Cargo.lock b/Cargo.lock index fe637cfc5b..554479940e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4149,7 +4149,6 @@ dependencies = [ "naga", "ndk-sys", "objc", - "once_cell", "ordered-float", "parking_lot", "profiling", diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 57103e4c05..4018a3e067 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -127,7 +127,6 @@ parking_lot.workspace = true profiling = { workspace = true, default-features = false } raw-window-handle.workspace = true thiserror.workspace = true -once_cell.workspace = true ordered-float = { workspace = true, optional = true } # backends common diff --git a/wgpu-hal/src/gles/egl.rs b/wgpu-hal/src/gles/egl.rs index 399d467e3a..a12ed6a7ca 100644 --- a/wgpu-hal/src/gles/egl.rs +++ b/wgpu-hal/src/gles/egl.rs @@ -1,9 +1,8 @@ use glow::HasContext; use hashbrown::HashMap; -use once_cell::sync::Lazy; use parking_lot::{MappedMutexGuard, Mutex, MutexGuard, RwLock}; -use std::{ffi, mem::ManuallyDrop, os::raw, ptr, rc::Rc, sync::Arc, time::Duration}; +use std::{ffi, mem::ManuallyDrop, os::raw, ptr, rc::Rc, sync::{Arc, LazyLock}, time::Duration}; /// The amount of time to wait while trying to obtain a lock to the adapter context const CONTEXT_LOCK_TIMEOUT_SECS: u64 = 1; @@ -468,7 +467,8 @@ struct Inner { // Different calls to `eglGetPlatformDisplay` may return the same `Display`, making it a global // state of all our `EglContext`s. This forces us to track the number of such context to prevent // terminating the display if it's currently used by another `EglContext`. -static DISPLAYS_REFERENCE_COUNT: Lazy>> = Lazy::new(Default::default); +static DISPLAYS_REFERENCE_COUNT: LazyLock>> = + LazyLock::new(Default::default); fn initialize_display( egl: &EglInstance, diff --git a/wgpu-hal/src/gles/wgl.rs b/wgpu-hal/src/gles/wgl.rs index c1272371c8..ac3e7d73f0 100644 --- a/wgpu-hal/src/gles/wgl.rs +++ b/wgpu-hal/src/gles/wgl.rs @@ -5,7 +5,7 @@ use std::{ ptr, sync::{ mpsc::{sync_channel, SyncSender}, - Arc, + Arc, LazyLock, }, thread, time::Duration, @@ -17,7 +17,6 @@ use glutin_wgl_sys::wgl_extra::{ CONTEXT_PROFILE_MASK_ARB, }; use hashbrown::HashSet; -use once_cell::sync::Lazy; use parking_lot::{Mutex, MutexGuard, RwLock}; use raw_window_handle::{RawDisplayHandle, RawWindowHandle}; use wgt::InstanceFlags; @@ -320,8 +319,8 @@ fn create_global_window_class() -> Result { } fn get_global_window_class() -> Result { - static GLOBAL: Lazy> = - Lazy::new(create_global_window_class); + static GLOBAL: LazyLock> = + LazyLock::new(create_global_window_class); GLOBAL.clone() }