Skip to content

Commit 94b0c57

Browse files
committed
Migrate lazy initialization from once_cell to std
1 parent f9fe37f commit 94b0c57

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

Cargo.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ chrono = "0.4"
1414
clap = "3.1"
1515
cmd_lib = "1.3"
1616
futures = "0.3"
17-
lazy_static = "1.4"
1817
maplit = "1"
18+
once_cell = "1.19.0"
1919
rand = "0.8.5"
2020
regex = "1"
2121
reqwest = "0.11.13"

src/evergreen/evg_config_utils.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::{HashMap, HashSet};
22
use std::vec;
33

44
use anyhow::{bail, Result};
5-
use lazy_static::lazy_static;
5+
use std::sync::LazyLock;
66
use regex::Regex;
77
use shrub_rs::models::commands::EvgCommand::Function;
88
use shrub_rs::models::params::ParamValue;
@@ -15,12 +15,11 @@ use crate::evergreen_names::{
1515
};
1616
use crate::utils::task_name::remove_gen_suffix;
1717

18-
lazy_static! {
19-
/// Regular expression for finding expansions.
20-
/// `${expansion}` or `${expansion|default_value}`
21-
static ref EXPANSION_RE: Regex =
22-
Regex::new(r"\$\{(?P<id>[a-zA-Z0-9_]+)(\|(?P<default>.*))?}").unwrap();
23-
}
18+
/// Regular expression for finding expansions.
19+
/// `${expansion}` or `${expansion|default_value}`
20+
static EXPANSION_RE: LazyLock<Regex> = LazyLock::new(|| {
21+
Regex::new(r"\$\{(?P<id>[a-zA-Z0-9_]+)(\|(?P<default>.*))?}").unwrap()
22+
});
2423

2524
/// Multiversion task that will be generated.
2625
#[derive(Default, Debug, Clone, PartialEq)]

0 commit comments

Comments
 (0)