mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 08:06:03 +02:00
Drop once_cell
dependency (#14198)
This PR drops the `once_cell` dependency from all Nu crates, replacing uses of the [`Lazy`](https://docs.rs/once_cell/latest/once_cell/sync/struct.Lazy.html) type with its `std` equivalent, [`LazyLock`](https://doc.rust-lang.org/std/sync/struct.LazyLock.html).
This commit is contained in:
@ -21,7 +21,6 @@ fancy-regex = { workspace = true }
|
||||
lscolors = { workspace = true, default-features = false, features = ["nu-ansi-term"] }
|
||||
log = { workspace = true }
|
||||
num-format = { workspace = true }
|
||||
once_cell = { workspace = true }
|
||||
strip-ansi-escapes = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
sys-locale = "0.3"
|
||||
|
@ -1,12 +1,12 @@
|
||||
use fancy_regex::Regex;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
// This hits, in order:
|
||||
// • Any character of []:`{}#'";()|$,
|
||||
// • Any digit (\d)
|
||||
// • Any whitespace (\s)
|
||||
// • Case-insensitive sign-insensitive float "keywords" inf, infinity and nan.
|
||||
static NEEDS_QUOTING_REGEX: Lazy<Regex> = Lazy::new(|| {
|
||||
static NEEDS_QUOTING_REGEX: LazyLock<Regex> = LazyLock::new(|| {
|
||||
Regex::new(r#"[\[\]:`\{\}#'";\(\)\|\$,\d\s]|(?i)^[+\-]?(inf(inity)?|nan)$"#)
|
||||
.expect("internal error: NEEDS_QUOTING_REGEX didn't compile")
|
||||
});
|
||||
|
Reference in New Issue
Block a user