replace lazy_static with once_cell (#7502)

replacing the dependence on `lazy_static` with `once_cell`, this will
ensure that variables are initialized when needed instead of startup
time.
This commit is contained in:
Jaffar Ashoor
2022-12-17 21:30:04 +03:00
committed by GitHub
parent 90849a067f
commit c3c41a61b0
11 changed files with 69 additions and 99 deletions

View File

@ -2,12 +2,10 @@
use std::sync::{Arc, Mutex};
use lazy_static::lazy_static;
use nu_utils::locale::LOCALE_OVERRIDE_ENV_VAR;
use once_cell::sync::Lazy;
lazy_static! {
static ref LOCALE_OVERRIDE_MUTEX: Arc<Mutex<()>> = Arc::new(Mutex::new(()));
}
static LOCALE_OVERRIDE_MUTEX: Lazy<Arc<Mutex<()>>> = Lazy::new(Default::default);
/// Run a closure in a fake locale environment.
///