File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ mod glow;
7
7
mod shader;
8
8
9
9
use std:: collections:: HashSet ;
10
- use std:: sync:: { Mutex , OnceLock } ;
10
+ use std:: sync:: { LazyLock , Mutex } ;
11
11
12
12
use crate :: buffer_pool:: TexturePool ;
13
13
use crate :: descriptors:: Descriptors ;
@@ -277,7 +277,9 @@ impl Filters {
277
277
& filter,
278
278
) ,
279
279
filter => {
280
- static WARNED_FILTERS : OnceLock < Mutex < HashSet < & ' static str > > > = OnceLock :: new ( ) ;
280
+ static WARNED_FILTERS : LazyLock < Mutex < HashSet < & ' static str > > > =
281
+ LazyLock :: new ( Default :: default) ;
282
+
281
283
let name = match filter {
282
284
Filter :: GradientGlowFilter ( _) => "GradientGlowFilter" ,
283
285
Filter :: GradientBevelFilter ( _) => "GradientBevelFilter" ,
@@ -291,12 +293,7 @@ impl Filters {
291
293
| Filter :: ShaderFilter ( _) => unreachable ! ( ) ,
292
294
} ;
293
295
// Only warn once per filter type
294
- if WARNED_FILTERS
295
- . get_or_init ( Default :: default)
296
- . lock ( )
297
- . unwrap ( )
298
- . insert ( name)
299
- {
296
+ if WARNED_FILTERS . lock ( ) . unwrap ( ) . insert ( name) {
300
297
tracing:: warn!( "Unsupported filter {filter:?}" ) ;
301
298
}
302
299
None
You can’t perform that action at this time.
0 commit comments