diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-21 19:57:12 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-21 19:57:12 -0500 |
commit | c043a9b39dad5b3a45e1ee61f65edc8d695755b6 (patch) | |
tree | 4b79f97a1ee867f990c2dfeb77dc62b3b97a37c8 /src/regex.rs | |
parent | efc9896da7901421b4e687d377e0cb75e2e99c2a (diff) | |
download | advent-of-code-c043a9b39dad5b3a45e1ee61f65edc8d695755b6.tar.gz advent-of-code-c043a9b39dad5b3a45e1ee61f65edc8d695755b6.zip |
use once_cell instead of lazy_static
Diffstat (limited to 'src/regex.rs')
-rw-r--r-- | src/regex.rs | 5 |
1 files changed, 2 insertions, 3 deletions
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) }}; } |