mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +00:00
uucore: remove lazy_static & use LazyLock instead
This commit is contained in:
parent
0f9b36b0d4
commit
3b9b8c51cf
3 changed files with 4 additions and 8 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -3503,7 +3503,6 @@ dependencies = [
|
||||||
"hex",
|
"hex",
|
||||||
"iana-time-zone",
|
"iana-time-zone",
|
||||||
"itertools 0.14.0",
|
"itertools 0.14.0",
|
||||||
"lazy_static",
|
|
||||||
"libc",
|
"libc",
|
||||||
"md-5",
|
"md-5",
|
||||||
"memchr",
|
"memchr",
|
||||||
|
|
|
@ -31,7 +31,6 @@ dunce = { version = "1.0.4", optional = true }
|
||||||
wild = "2.2.1"
|
wild = "2.2.1"
|
||||||
glob = { workspace = true }
|
glob = { workspace = true }
|
||||||
iana-time-zone = { workspace = true }
|
iana-time-zone = { workspace = true }
|
||||||
lazy_static = "1.4.0"
|
|
||||||
# * optional
|
# * optional
|
||||||
itertools = { workspace = true, optional = true }
|
itertools = { workspace = true, optional = true }
|
||||||
thiserror = { workspace = true, optional = true }
|
thiserror = { workspace = true, optional = true }
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
// spell-checker:ignore anotherfile invalidchecksum regexes JWZG FFFD xffname prefixfilename bytelen bitlen hexdigit
|
// spell-checker:ignore anotherfile invalidchecksum regexes JWZG FFFD xffname prefixfilename bytelen bitlen hexdigit
|
||||||
|
|
||||||
use data_encoding::BASE64;
|
use data_encoding::BASE64;
|
||||||
use lazy_static::lazy_static;
|
|
||||||
use os_display::Quotable;
|
use os_display::Quotable;
|
||||||
use regex::bytes::{Match, Regex};
|
use regex::bytes::{Match, Regex};
|
||||||
use std::{
|
use std::{
|
||||||
|
@ -16,6 +15,7 @@ use std::{
|
||||||
io::{self, stdin, BufReader, Read, Write},
|
io::{self, stdin, BufReader, Read, Write},
|
||||||
path::Path,
|
path::Path,
|
||||||
str,
|
str,
|
||||||
|
sync::LazyLock,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -478,11 +478,9 @@ const DOUBLE_SPACE_REGEX: &str = r"^(?P<checksum>[a-fA-F0-9]+)\s{2}(?P<filename>
|
||||||
// In this case, we ignore the *
|
// In this case, we ignore the *
|
||||||
const SINGLE_SPACE_REGEX: &str = r"^(?P<checksum>[a-fA-F0-9]+)\s(?P<filename>\*?(?-u:.*))$";
|
const SINGLE_SPACE_REGEX: &str = r"^(?P<checksum>[a-fA-F0-9]+)\s(?P<filename>\*?(?-u:.*))$";
|
||||||
|
|
||||||
lazy_static! {
|
static R_ALGO_BASED: LazyLock<Regex> = LazyLock::new(|| Regex::new(ALGO_BASED_REGEX).unwrap());
|
||||||
static ref R_ALGO_BASED: Regex = Regex::new(ALGO_BASED_REGEX).unwrap();
|
static R_DOUBLE_SPACE: LazyLock<Regex> = LazyLock::new(|| Regex::new(DOUBLE_SPACE_REGEX).unwrap());
|
||||||
static ref R_DOUBLE_SPACE: Regex = Regex::new(DOUBLE_SPACE_REGEX).unwrap();
|
static R_SINGLE_SPACE: LazyLock<Regex> = LazyLock::new(|| Regex::new(SINGLE_SPACE_REGEX).unwrap());
|
||||||
static ref R_SINGLE_SPACE: Regex = Regex::new(SINGLE_SPACE_REGEX).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||||
enum LineFormat {
|
enum LineFormat {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue