@@ -130,6 +130,7 @@ use indexmap::IndexMap;
130130use naga:: EntryPoint ;
131131use regex:: Regex ;
132132use std:: collections:: { hash_map:: Entry , BTreeMap , HashMap , HashSet } ;
133+ use std:: sync:: LazyLock ;
133134use tracing:: { debug, trace} ;
134135
135136use crate :: {
@@ -348,17 +349,17 @@ impl Default for Composer {
348349 check_decoration_regex : Regex :: new (
349350 format ! (
350351 "({}|{})" ,
351- regex_syntax :: escape( DECORATION_PRE ) ,
352- regex_syntax :: escape( DECORATION_OVERRIDE_PRE )
352+ regex :: escape( DECORATION_PRE ) ,
353+ regex :: escape( DECORATION_OVERRIDE_PRE )
353354 )
354355 . as_str ( ) ,
355356 )
356357 . unwrap ( ) ,
357358 undecorate_regex : Regex :: new (
358359 format ! (
359360 r"(\x1B\[\d+\w)?([\w\d_]+){}([A-Z0-9]*){}" ,
360- regex_syntax :: escape( DECORATION_PRE ) ,
361- regex_syntax :: escape( DECORATION_POST )
361+ regex :: escape( DECORATION_PRE ) ,
362+ regex :: escape( DECORATION_POST )
362363 )
363364 . as_str ( ) ,
364365 )
@@ -370,17 +371,17 @@ impl Default for Composer {
370371 override_fn_regex : Regex :: new (
371372 format ! (
372373 r"(override\s+fn\s+)([^\s]+){}([\w\d]+){}(\s*)\(" ,
373- regex_syntax :: escape( DECORATION_PRE ) ,
374- regex_syntax :: escape( DECORATION_POST )
374+ regex :: escape( DECORATION_PRE ) ,
375+ regex :: escape( DECORATION_POST )
375376 )
376377 . as_str ( ) ,
377378 )
378379 . unwrap ( ) ,
379380 undecorate_override_regex : Regex :: new (
380381 format ! (
381382 "{}([A-Z0-9]*){}" ,
382- regex_syntax :: escape( DECORATION_OVERRIDE_PRE ) ,
383- regex_syntax :: escape( DECORATION_POST )
383+ regex :: escape( DECORATION_OVERRIDE_PRE ) ,
384+ regex :: escape( DECORATION_POST )
384385 )
385386 . as_str ( ) ,
386387 )
@@ -1927,8 +1928,7 @@ impl Composer {
19271928 }
19281929}
19291930
1930- static PREPROCESSOR : once_cell:: sync:: Lazy < Preprocessor > =
1931- once_cell:: sync:: Lazy :: new ( Preprocessor :: default) ;
1931+ static PREPROCESSOR : LazyLock < Preprocessor > = LazyLock :: new ( Preprocessor :: default) ;
19321932
19331933/// Get module name and all required imports (ignoring shader_defs) from a shader string
19341934pub fn get_preprocessor_data (
0 commit comments