@@ -15,12 +15,12 @@ use fancy_regex::{
1515 CaptureMatches as FancyCaptureMatches , Captures as FancyCaptures , Regex as FancyRegex ,
1616} ;
1717use memchr:: memmem;
18- use once_cell:: sync:: Lazy ;
1918use regex:: Regex as RustRegex ;
2019use regex:: bytes:: {
2120 CaptureMatches as ByteCaptureMatches , Captures as ByteCaptures , Regex as ByteRegex ,
2221} ;
2322use std:: error:: Error ;
23+ use std:: sync:: LazyLock ;
2424use uucore:: error:: { UResult , USimpleError } ;
2525
2626use crate :: sed:: fast_io:: IOChunk ;
@@ -32,7 +32,8 @@ use crate::sed::fast_io::IOChunk;
3232// For example, r"\\1" and r"[\1]" will match, whereas only a number
3333// after an odd number of backslashes and outside a character class
3434// should match.
35- static NEEDS_FANCY_RE : Lazy < RustRegex > = Lazy :: new ( || regex:: Regex :: new ( r"\\[1-9]" ) . unwrap ( ) ) ;
35+ static NEEDS_FANCY_RE : LazyLock < RustRegex > =
36+ LazyLock :: new ( || regex:: Regex :: new ( r"\\[1-9]" ) . unwrap ( ) ) ;
3637
3738/// All characters signifying that the match must be handled by an RE
3839/// rather than by plain string pattern matching.
@@ -41,7 +42,7 @@ static NEEDS_FANCY_RE: Lazy<RustRegex> = Lazy::new(|| regex::Regex::new(r"\\[1-9
4142// matching, because Regex always constructs an automaton and needs
4243// to handle state transitions, whereas plain string matching can
4344// use tailored CPU string or vectored instructions.
44- static NEEDS_RE : Lazy < RustRegex > = Lazy :: new ( || {
45+ static NEEDS_RE : LazyLock < RustRegex > = LazyLock :: new ( || {
4546 regex:: Regex :: new (
4647 r"(?x) # Turn on verbose mode
4748 ( ^ # Non-escaped: i.e. at BOL
0 commit comments