summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/regex.rs5
3 files changed, 4 insertions, 5 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 403b53b..02310cf 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8,7 +8,7 @@ version = "0.1.0"
dependencies = [
"ahash",
"anyhow",
- "lazy_static",
+ "once_cell",
"paw",
"priority-queue",
"regex",
diff --git a/Cargo.toml b/Cargo.toml
index e863961..a673a01 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ edition = "2021"
[dependencies]
ahash = "0.7.6"
anyhow = "1.0.51"
-lazy_static = "1.4.0"
+once_cell = "1.9.0"
paw = "1.0.0"
priority-queue = "1.2.1"
regex = "1.5.4"
diff --git a/src/regex.rs b/src/regex.rs
index 56ce19f..12f8876 100644
--- a/src/regex.rs
+++ b/src/regex.rs
@@ -1,8 +1,7 @@
macro_rules! regex_captures {
($rx:expr, $s:expr $(,)?) => {{
- lazy_static::lazy_static! {
- static ref RX: Regex = regex::Regex::new($rx).unwrap();
- }
+ static RX: once_cell::sync::Lazy<regex::Regex> =
+ once_cell::sync::Lazy::new(|| regex::Regex::new($rx).unwrap());
RX.captures($s)
}};
}