From c0ecf8684e349c06e49cb5ba699142649b1b707d Mon Sep 17 00:00:00 2001 From: FalkWoldmann <52786457+FalkWoldmann@users.noreply.github.com> Date: Fri, 28 Feb 2025 00:34:37 +0100 Subject: [PATCH] Remove `once_cell` dependency (#25769) Release Notes: - N/A --------- Co-authored-by: Marshall Bowers --- Cargo.lock | 1 - Cargo.toml | 1 - crates/component/Cargo.toml | 1 - crates/component/src/component.rs | 6 +++--- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0a8b14ce4a43c1fa730c822557a7d740e3350d06..ba370d32f956f06a943f9a854dfe5da4d0f6dc5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3003,7 +3003,6 @@ dependencies = [ "collections", "gpui", "linkme", - "once_cell", "parking_lot", "theme", ] diff --git a/Cargo.toml b/Cargo.toml index bafcf978bd026d8a7aa22df60c025d4fd3b43091..5929bb239965b6a28b875d2640ea1548ab149807 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -455,7 +455,6 @@ nanoid = "0.4" nbformat = { version = "0.10.0" } nix = "0.29" num-format = "0.4.4" -once_cell = "1.20" ordered-float = "2.1.1" palette = { version = "0.7.5", default-features = false, features = ["std"] } parking_lot = "0.12.1" diff --git a/crates/component/Cargo.toml b/crates/component/Cargo.toml index 3eef8a8d647a9450339218346bdf20542e69c38c..edb3bdda3c0f15d7ff6b5fe1343925e1d5b6b2a7 100644 --- a/crates/component/Cargo.toml +++ b/crates/component/Cargo.toml @@ -15,7 +15,6 @@ path = "src/component.rs" collections.workspace = true gpui.workspace = true linkme.workspace = true -once_cell.workspace = true parking_lot.workspace = true theme.workspace = true diff --git a/crates/component/src/component.rs b/crates/component/src/component.rs index 00c1be661ad8e1eab509322245919bf6caed575e..d53a951f2ad78e493c44f2c716dd898169ed0294 100644 --- a/crates/component/src/component.rs +++ b/crates/component/src/component.rs @@ -1,9 +1,9 @@ use std::ops::{Deref, DerefMut}; +use std::sync::LazyLock; use collections::HashMap; use gpui::{div, prelude::*, px, AnyElement, App, IntoElement, RenderOnce, SharedString, Window}; use linkme::distributed_slice; -use once_cell::sync::Lazy; use parking_lot::RwLock; use theme::ActiveTheme; @@ -27,8 +27,8 @@ pub static __ALL_COMPONENTS: [fn()] = [..]; #[distributed_slice] pub static __ALL_PREVIEWS: [fn()] = [..]; -pub static COMPONENT_DATA: Lazy> = - Lazy::new(|| RwLock::new(ComponentRegistry::new())); +pub static COMPONENT_DATA: LazyLock> = + LazyLock::new(|| RwLock::new(ComponentRegistry::new())); pub struct ComponentRegistry { components: Vec<(Option<&'static str>, &'static str, Option<&'static str>)>,