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",
|
"merge",
|
||||||
"nix 0.29.0",
|
"nix 0.29.0",
|
||||||
"notify-rust",
|
"notify-rust",
|
||||||
"once_cell",
|
|
||||||
"parselnk",
|
"parselnk",
|
||||||
"regex",
|
"regex",
|
||||||
"regex-split",
|
"regex-split",
|
||||||
|
|||||||
@@ -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" }
|
||||||
|
|||||||
@@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user