chore: use std::sync::LazyLock
Removes `once_cell` as a direct dependency.
This commit is contained in:
parent
467716c167
commit
c3fafd3910
42 changed files with 77 additions and 106 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use std::collections::HashSet;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use cosmic::{
|
||||
app,
|
||||
|
|
@ -26,7 +27,7 @@ use cosmic::{
|
|||
use cosmic_dbus_networkmanager::interface::enums::{
|
||||
ActiveConnectionState, DeviceState, NmConnectivityState,
|
||||
};
|
||||
use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline};
|
||||
use cosmic_time::{anim, chain, id, Instant, Timeline};
|
||||
|
||||
use futures::channel::mpsc::UnboundedSender;
|
||||
use zbus::Connection;
|
||||
|
|
@ -90,8 +91,8 @@ impl From<NewConnectionState> for AccessPoint {
|
|||
}
|
||||
}
|
||||
|
||||
static WIFI: Lazy<id::Toggler> = Lazy::new(id::Toggler::unique);
|
||||
static AIRPLANE_MODE: Lazy<id::Toggler> = Lazy::new(id::Toggler::unique);
|
||||
static WIFI: LazyLock<id::Toggler> = LazyLock::new(id::Toggler::unique);
|
||||
static AIRPLANE_MODE: LazyLock<id::Toggler> = LazyLock::new(id::Toggler::unique);
|
||||
|
||||
#[derive(Default)]
|
||||
struct CosmicNetworkApplet {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
// SPDX-License-Identifier: MPL-2.0-only
|
||||
|
||||
use cosmic_time::once_cell::sync::Lazy;
|
||||
use i18n_embed::{
|
||||
fluent::{fluent_language_loader, FluentLanguageLoader},
|
||||
DefaultLocalizer, LanguageLoader, Localizer,
|
||||
};
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue