Remove lazy_static from dependencies

This commit is contained in:
Shun Sakai 2021-11-25 22:34:54 +09:00 committed by David Peter
parent f32060b0de
commit 0484486f3f
4 changed files with 6 additions and 10 deletions

1
Cargo.lock generated
View file

@ -172,7 +172,6 @@ dependencies = [
"humantime", "humantime",
"ignore", "ignore",
"jemallocator", "jemallocator",
"lazy_static",
"libc", "libc",
"lscolors", "lscolors",
"nix", "nix",

View file

@ -37,7 +37,6 @@ version_check = "0.9"
ansi_term = "0.12" ansi_term = "0.12"
atty = "0.2" atty = "0.2"
ignore = "0.4.3" ignore = "0.4.3"
lazy_static = "1.1.0"
num_cpus = "1.8" num_cpus = "1.8"
regex = "1.5.4" regex = "1.5.4"
regex-syntax = "0.6" regex-syntax = "0.6"

View file

@ -10,7 +10,7 @@ use std::process::{Command, Stdio};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use anyhow::{anyhow, Result}; use anyhow::{anyhow, Result};
use lazy_static::lazy_static; use once_cell::sync::Lazy;
use regex::Regex; use regex::Regex;
use crate::exit_codes::ExitCode; use crate::exit_codes::ExitCode;
@ -72,9 +72,8 @@ impl CommandTemplate {
I: IntoIterator<Item = S>, I: IntoIterator<Item = S>,
S: AsRef<str>, S: AsRef<str>,
{ {
lazy_static! { static PLACEHOLDER_PATTERN: Lazy<Regex> =
static ref PLACEHOLDER_PATTERN: Regex = Regex::new(r"\{(/?\.?|//)\}").unwrap(); Lazy::new(|| Regex::new(r"\{(/?\.?|//)\}").unwrap());
}
let mut args = Vec::new(); let mut args = Vec::new();
let mut has_placeholder = false; let mut has_placeholder = false;

View file

@ -1,9 +1,8 @@
use lazy_static::lazy_static; use once_cell::sync::Lazy;
use regex::Regex; use regex::Regex;
lazy_static! { static SIZE_CAPTURES: Lazy<Regex> =
static ref SIZE_CAPTURES: Regex = Regex::new(r"(?i)^([+-]?)(\d+)(b|[kmgt]i?b?)$").unwrap(); Lazy::new(|| Regex::new(r"(?i)^([+-]?)(\d+)(b|[kmgt]i?b?)$").unwrap());
}
#[derive(Clone, Copy, Debug, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq)]
pub enum SizeFilter { pub enum SizeFilter {