chore: remove once_cell dependency

This commit is contained in:
Tommy Volk 2024-10-03 22:27:25 -05:00 committed by Héctor Ramón Jiménez
parent b156087fcf
commit 0e8c3fe30f
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
20 changed files with 80 additions and 96 deletions

View file

@ -33,7 +33,6 @@ bytemuck.workspace = true
cosmic-text.workspace = true
half.workspace = true
log.workspace = true
once_cell.workspace = true
raw-window-handle.workspace = true
rustc-hash.workspace = true
thiserror.workspace = true

View file

@ -14,10 +14,9 @@ use crate::core::font::{self, Font};
use crate::core::text::{Shaping, Wrapping};
use crate::core::{Color, Pixels, Point, Rectangle, Size, Transformation};
use once_cell::sync::OnceCell;
use std::borrow::Cow;
use std::collections::HashSet;
use std::sync::{Arc, RwLock, Weak};
use std::sync::{Arc, OnceLock, RwLock, Weak};
/// A text primitive.
#[derive(Debug, Clone, PartialEq)]
@ -157,7 +156,7 @@ pub const FIRA_SANS_REGULAR: &[u8] =
/// Returns the global [`FontSystem`].
pub fn font_system() -> &'static RwLock<FontSystem> {
static FONT_SYSTEM: OnceCell<RwLock<FontSystem>> = OnceCell::new();
static FONT_SYSTEM: OnceLock<RwLock<FontSystem>> = OnceLock::new();
FONT_SYSTEM.get_or_init(|| {
RwLock::new(FontSystem {