Migrate from lazy_static to once_cell
This commit is contained in:
parent
4c39b3188c
commit
2c01e9e747
18 changed files with 477 additions and 519 deletions
|
|
@ -18,6 +18,8 @@ use std::{collections::VecDeque, env, fmt};
|
|||
#[cfg(feature = "x11")]
|
||||
use std::{ffi::CStr, mem::MaybeUninit, os::raw::*, sync::Arc};
|
||||
|
||||
#[cfg(feature = "x11")]
|
||||
use once_cell::sync::Lazy;
|
||||
#[cfg(feature = "x11")]
|
||||
use parking_lot::Mutex;
|
||||
use raw_window_handle::RawWindowHandle;
|
||||
|
|
@ -135,10 +137,8 @@ impl Default for PlatformSpecificWindowBuilderAttributes {
|
|||
}
|
||||
|
||||
#[cfg(feature = "x11")]
|
||||
lazy_static! {
|
||||
pub static ref X11_BACKEND: Mutex<Result<Arc<XConnection>, XNotSupported>> =
|
||||
Mutex::new(XConnection::new(Some(x_error_callback)).map(Arc::new));
|
||||
}
|
||||
pub static X11_BACKEND: Lazy<Mutex<Result<Arc<XConnection>, XNotSupported>>> =
|
||||
Lazy::new(|| Mutex::new(XConnection::new(Some(x_error_callback)).map(Arc::new)));
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum OsError {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue