Skip to content

Commit da6d7ca

Browse files
committed
tidy static regex: OnceLock -> LazyLock
1 parent 0d6dc2f commit da6d7ca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tools/tidy/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ use termcolor::WriteColor;
1313

1414
macro_rules! static_regex {
1515
($re:literal) => {{
16-
static RE: ::std::sync::OnceLock<::regex::Regex> = ::std::sync::OnceLock::new();
17-
RE.get_or_init(|| ::regex::Regex::new($re).unwrap())
16+
static RE: ::std::sync::LazyLock<::regex::Regex> =
17+
::std::sync::LazyLock::new(|| ::regex::Regex::new($re).unwrap());
18+
&*RE
1819
}};
1920
}
2021

0 commit comments

Comments
 (0)