File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ default = ["serde_support"]
2323
2424[dependencies ]
2525precomputed-hash = " 0.1"
26- lazy_static = " 1.1 .0"
26+ once_cell = " 1.10 .0"
2727serde = { version = " 1" , optional = true }
2828phf_shared = " 0.10"
2929new_debug_unreachable = " 1.0.2"
Original file line number Diff line number Diff line change 77// option. This file may not be copied, modified, or distributed
88// except according to those terms.
99
10- use lazy_static :: lazy_static ;
10+ use once_cell :: sync :: Lazy ;
1111use parking_lot:: Mutex ;
1212use std:: borrow:: Cow ;
1313use std:: mem;
@@ -38,16 +38,16 @@ fn entry_alignment_is_sufficient() {
3838 assert ! ( mem:: align_of:: <Entry >( ) >= ENTRY_ALIGNMENT ) ;
3939}
4040
41- lazy_static ! {
42- pub ( crate ) static ref DYNAMIC_SET : Mutex < Set > = Mutex :: new( {
41+ pub ( crate ) static DYNAMIC_SET : Lazy < Mutex < Set > > = Lazy :: new ( || {
42+ Mutex :: new ( {
4343 type T = Option < Box < Entry > > ;
4444 let _static_assert_size_eq = std:: mem:: transmute :: < T , usize > ;
4545 let vec = std:: mem:: ManuallyDrop :: new ( vec ! [ 0_usize ; NB_BUCKETS ] ) ;
4646 Set {
4747 buckets : unsafe { Box :: from_raw ( vec. as_ptr ( ) as * mut [ T ; NB_BUCKETS ] ) } ,
4848 }
49- } ) ;
50- }
49+ } )
50+ } ) ;
5151
5252impl Set {
5353 pub ( crate ) fn insert ( & mut self , string : Cow < str > , hash : u32 ) -> NonNull < Entry > {
You can’t perform that action at this time.
0 commit comments