m: Remove once_cell dependency

Removes the once_cell dependency, instead using std::sync::OnceLock and a
minimal polyfill for std::sync::LazyLock, which may be stabilized soon
(see rust-lang/rust#121377).

This should not require a bump in MSRV, as OnceLock was stabilized in 1.70,
which this crate is using.
This commit is contained in:
James Liu 2024-02-25 08:19:27 -08:00 committed by GitHub
parent 990bbf178f
commit 352e70b8ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 57 additions and 27 deletions

View file

@ -3,8 +3,8 @@ use std::os::raw::c_char;
use std::ptr::{self, NonNull};
use std::sync::atomic::{AtomicBool, Ordering};
use crate::utils::Lazy;
use log::warn;
use once_cell::sync::Lazy;
use smol_str::SmolStr;
#[cfg(wayland_platform)]
use std::os::unix::io::OwnedFd;

View file

@ -11,7 +11,7 @@ use std::{collections::VecDeque, env, fmt};
use std::{ffi::CStr, mem::MaybeUninit, os::raw::*, sync::Mutex};
#[cfg(x11_platform)]
use once_cell::sync::Lazy;
use crate::utils::Lazy;
use smol_str::SmolStr;
#[cfg(x11_platform)]

View file

@ -8,7 +8,7 @@ use std::{
};
use super::{super::atoms::*, ffi, util, XConnection, XError};
use once_cell::sync::Lazy;
use crate::utils::Lazy;
use x11rb::protocol::xproto;
static GLOBAL_LOCK: Lazy<Mutex<()>> = Lazy::new(Default::default);

View file

@ -1,6 +1,6 @@
use std::sync::Mutex;
use once_cell::sync::Lazy;
use crate::utils::Lazy;
use super::*;