diff --git a/Cargo.lock b/Cargo.lock index 469adcf..4cc7fcf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -172,7 +172,6 @@ dependencies = [ "humantime", "ignore", "jemallocator", - "lazy_static", "libc", "lscolors", "nix", diff --git a/Cargo.toml b/Cargo.toml index 674772f..e8f2129 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,6 @@ version_check = "0.9" ansi_term = "0.12" atty = "0.2" ignore = "0.4.3" -lazy_static = "1.1.0" num_cpus = "1.8" regex = "1.5.4" regex-syntax = "0.6" diff --git a/src/exec/mod.rs b/src/exec/mod.rs index a364e86..fc22e6f 100644 --- a/src/exec/mod.rs +++ b/src/exec/mod.rs @@ -10,7 +10,7 @@ use std::process::{Command, Stdio}; use std::sync::{Arc, Mutex}; use anyhow::{anyhow, Result}; -use lazy_static::lazy_static; +use once_cell::sync::Lazy; use regex::Regex; use crate::exit_codes::ExitCode; @@ -72,9 +72,8 @@ impl CommandTemplate { I: IntoIterator, S: AsRef, { - lazy_static! { - static ref PLACEHOLDER_PATTERN: Regex = Regex::new(r"\{(/?\.?|//)\}").unwrap(); - } + static PLACEHOLDER_PATTERN: Lazy = + Lazy::new(|| Regex::new(r"\{(/?\.?|//)\}").unwrap()); let mut args = Vec::new(); let mut has_placeholder = false; diff --git a/src/filter/size.rs b/src/filter/size.rs index 5435b19..2af20bc 100644 --- a/src/filter/size.rs +++ b/src/filter/size.rs @@ -1,9 +1,8 @@ -use lazy_static::lazy_static; +use once_cell::sync::Lazy; use regex::Regex; -lazy_static! { - static ref SIZE_CAPTURES: Regex = Regex::new(r"(?i)^([+-]?)(\d+)(b|[kmgt]i?b?)$").unwrap(); -} +static SIZE_CAPTURES: Lazy = + Lazy::new(|| Regex::new(r"(?i)^([+-]?)(\d+)(b|[kmgt]i?b?)$").unwrap()); #[derive(Clone, Copy, Debug, PartialEq)] pub enum SizeFilter {