Remove once_cell dependency from nu-test-support create. (#8568)

I was looking where we could remove the usage of once-cell dependency.
As for now, I only found one place. Not a terrible improvement, but at
least, it removes a dependency nu-test-support crate.

Relies on `Mutex::new` constified in Rust 1.63.0
This commit is contained in:
Jérémy Audiger
2023-03-22 19:36:52 +01:00
committed by GitHub
parent 626410b2aa
commit 0f4a073eaf
3 changed files with 2 additions and 5 deletions

View File

@ -1,11 +1,10 @@
#![cfg(debug_assertions)]
use std::sync::{Arc, Mutex};
use std::sync::Mutex;
use nu_utils::locale::LOCALE_OVERRIDE_ENV_VAR;
use once_cell::sync::Lazy;
static LOCALE_OVERRIDE_MUTEX: Lazy<Arc<Mutex<()>>> = Lazy::new(Default::default);
static LOCALE_OVERRIDE_MUTEX: Mutex<()> = Mutex::new(());
/// Run a closure in a fake locale environment.
///