From da6d7ca1be6586ba8e0d2b89f1d60ff256dfc7ea Mon Sep 17 00:00:00 2001 From: Marijn Schouten Date: Tue, 15 Jul 2025 08:59:41 +0000 Subject: tidy static regex: OnceLock -> LazyLock --- src/tools/tidy/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tools/tidy/src/lib.rs b/src/tools/tidy/src/lib.rs index bd8660797a8..a301781fac8 100644 --- a/src/tools/tidy/src/lib.rs +++ b/src/tools/tidy/src/lib.rs @@ -13,8 +13,9 @@ use termcolor::WriteColor; macro_rules! static_regex { ($re:literal) => {{ - static RE: ::std::sync::OnceLock<::regex::Regex> = ::std::sync::OnceLock::new(); - RE.get_or_init(|| ::regex::Regex::new($re).unwrap()) + static RE: ::std::sync::LazyLock<::regex::Regex> = + ::std::sync::LazyLock::new(|| ::regex::Regex::new($re).unwrap()); + &*RE }}; } -- cgit 1.4.1-3-g733a5