chore: use std::sync::LazyLock

Removes `once_cell` as a direct dependency.
This commit is contained in:
Vukašin Vojinović 2025-08-12 19:59:56 +02:00 committed by Michael Murphy
parent 467716c167
commit c3fafd3910
42 changed files with 77 additions and 106 deletions

View file

@ -22,7 +22,7 @@ use cosmic::{
widget::{autosize, button, divider, icon, layer_container::layer_container, text, Space},
Element, Task,
};
use once_cell::sync::Lazy;
use std::sync::LazyLock;
use logind_zbus::{
manager::ManagerProxy,
@ -39,8 +39,8 @@ pub mod session_manager;
use crate::{cosmic_session::CosmicSessionProxy, session_manager::SessionManagerProxy};
static SUBSURFACE_ID: Lazy<cosmic::widget::Id> =
Lazy::new(|| cosmic::widget::Id::new("subsurface"));
static SUBSURFACE_ID: LazyLock<cosmic::widget::Id> =
LazyLock::new(|| cosmic::widget::Id::new("subsurface"));
pub fn run() -> cosmic::iced::Result {
localize::localize();

View file

@ -5,14 +5,14 @@ use i18n_embed::{
fluent::{fluent_language_loader, FluentLanguageLoader},
DefaultLocalizer, LanguageLoader, Localizer,
};
use once_cell::sync::Lazy;
use rust_embed::RustEmbed;
use std::sync::LazyLock;
#[derive(RustEmbed)]
#[folder = "i18n/"]
struct Localizations;
pub static LANGUAGE_LOADER: Lazy<FluentLanguageLoader> = Lazy::new(|| {
pub static LANGUAGE_LOADER: LazyLock<FluentLanguageLoader> = LazyLock::new(|| {
let loader: FluentLanguageLoader = fluent_language_loader!();
loader