refactor: replace once_cell crate with std equivalent (#1260)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -2909,7 +2909,6 @@ dependencies = [
|
||||
"merge",
|
||||
"nix 0.29.0",
|
||||
"notify-rust",
|
||||
"once_cell",
|
||||
"parselnk",
|
||||
"regex",
|
||||
"regex-split",
|
||||
|
||||
@@ -23,7 +23,6 @@ path = "src/main.rs"
|
||||
[dependencies]
|
||||
home = "~0.5"
|
||||
etcetera = "~0.8"
|
||||
once_cell = "~1.19"
|
||||
serde = { version = "~1.0", features = ["derive"] }
|
||||
toml = "0.8"
|
||||
which_crate = { version = "~6.0", package = "which" }
|
||||
|
||||
@@ -17,8 +17,8 @@ use etcetera::base_strategy::BaseStrategy;
|
||||
use etcetera::base_strategy::Windows;
|
||||
#[cfg(unix)]
|
||||
use etcetera::base_strategy::Xdg;
|
||||
use once_cell::sync::Lazy;
|
||||
use rust_i18n::{i18n, t};
|
||||
use std::sync::LazyLock;
|
||||
use tracing::debug;
|
||||
|
||||
use self::config::{CommandLineArgs, Config};
|
||||
@@ -50,12 +50,12 @@ mod sudo;
|
||||
mod terminal;
|
||||
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)]
|
||||
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)]
|
||||
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
|
||||
i18n!("locales", fallback = "en");
|
||||
|
||||
Reference in New Issue
Block a user