refactor: replace once_cell crate with std equivalent (#1260)

This commit is contained in:
Falk Woldmann Lu
2025-08-11 09:57:32 +02:00
committed by GitHub
parent 4f5e8a8836
commit 9048cd8f47
3 changed files with 4 additions and 6 deletions

1
Cargo.lock generated
View File

@@ -2909,7 +2909,6 @@ dependencies = [
"merge", "merge",
"nix 0.29.0", "nix 0.29.0",
"notify-rust", "notify-rust",
"once_cell",
"parselnk", "parselnk",
"regex", "regex",
"regex-split", "regex-split",

View File

@@ -23,7 +23,6 @@ path = "src/main.rs"
[dependencies] [dependencies]
home = "~0.5" home = "~0.5"
etcetera = "~0.8" etcetera = "~0.8"
once_cell = "~1.19"
serde = { version = "~1.0", features = ["derive"] } serde = { version = "~1.0", features = ["derive"] }
toml = "0.8" toml = "0.8"
which_crate = { version = "~6.0", package = "which" } which_crate = { version = "~6.0", package = "which" }

View File

@@ -17,8 +17,8 @@ use etcetera::base_strategy::BaseStrategy;
use etcetera::base_strategy::Windows; use etcetera::base_strategy::Windows;
#[cfg(unix)] #[cfg(unix)]
use etcetera::base_strategy::Xdg; use etcetera::base_strategy::Xdg;
use once_cell::sync::Lazy;
use rust_i18n::{i18n, t}; use rust_i18n::{i18n, t};
use std::sync::LazyLock;
use tracing::debug; use tracing::debug;
use self::config::{CommandLineArgs, Config}; use self::config::{CommandLineArgs, Config};
@@ -50,12 +50,12 @@ mod sudo;
mod terminal; mod terminal;
mod utils; mod utils;
pub(crate) static HOME_DIR: Lazy<PathBuf> = Lazy::new(|| home::home_dir().expect("No home directory")); pub(crate) static HOME_DIR: LazyLock<PathBuf> = LazyLock::new(|| home::home_dir().expect("No home directory"));
#[cfg(unix)] #[cfg(unix)]
pub(crate) static XDG_DIRS: Lazy<Xdg> = Lazy::new(|| Xdg::new().expect("No home directory")); pub(crate) static XDG_DIRS: LazyLock<Xdg> = LazyLock::new(|| Xdg::new().expect("No home directory"));
#[cfg(windows)] #[cfg(windows)]
pub(crate) static WINDOWS_DIRS: Lazy<Windows> = Lazy::new(|| Windows::new().expect("No home directory")); pub(crate) static WINDOWS_DIRS: LazyLock<Windows> = LazyLock::new(|| Windows::new().expect("No home directory"));
// Init and load the i18n files // Init and load the i18n files
i18n!("locales", fallback = "en"); i18n!("locales", fallback = "en");