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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

1
Cargo.lock generated
View File

@ -3039,7 +3039,6 @@ dependencies = [
"nu-path",
"nu-utils",
"num-format",
"once_cell",
"tempfile",
"which",
]

View File

@ -15,7 +15,6 @@ bench = false
nu-path = { path="../nu-path", version = "0.77.2" }
nu-glob = { path = "../nu-glob", version = "0.77.2" }
nu-utils = { path="../nu-utils", version = "0.77.2" }
once_cell = "1.16.0"
num-format = "0.4.3"
which = "4.3.0"

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.
///