File tree Expand file tree Collapse file tree 5 files changed +12
-90
lines changed Expand file tree Collapse file tree 5 files changed +12
-90
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,15 @@ rust-version = "1.65.0"
26
26
27
27
[features ]
28
28
default = [" std" , " valuable?/std" ]
29
- std = [" once_cell" ]
29
+ std = []
30
+ # used to be an implicit feature from an optional dependency
31
+ # FIXME: remove with the next breaking-change release
32
+ once_cell = []
30
33
31
34
[badges ]
32
35
maintenance = { status = " actively-developed" }
33
36
34
37
[dependencies ]
35
- once_cell = { version = " 1.13.0" , optional = true }
36
38
37
39
[target .'cfg(tracing_unstable)' .dependencies ]
38
40
valuable = { version = " 0.1.0" , optional = true , default-features = false }
Original file line number Diff line number Diff line change @@ -109,7 +109,6 @@ use crate::stdlib::{
109
109
} ;
110
110
use crate :: {
111
111
dispatcher:: Dispatch ,
112
- lazy:: Lazy ,
113
112
metadata:: { LevelFilter , Metadata } ,
114
113
subscriber:: Interest ,
115
114
} ;
@@ -260,7 +259,7 @@ static CALLSITES: Callsites = Callsites {
260
259
261
260
static DISPATCHERS : Dispatchers = Dispatchers :: new ( ) ;
262
261
263
- static LOCKED_CALLSITES : Lazy < Mutex < Vec < & ' static dyn Callsite > > > = Lazy :: new ( Default :: default ) ;
262
+ static LOCKED_CALLSITES : Mutex < Vec < & ' static dyn Callsite > > = Mutex :: new ( Vec :: new ( ) ) ;
264
263
265
264
struct Callsites {
266
265
list_head : AtomicPtr < DefaultCallsite > ,
@@ -515,7 +514,7 @@ mod private {
515
514
516
515
#[ cfg( feature = "std" ) ]
517
516
mod dispatchers {
518
- use crate :: { dispatcher, lazy :: Lazy } ;
517
+ use crate :: dispatcher;
519
518
use std:: sync:: {
520
519
atomic:: { AtomicBool , Ordering } ,
521
520
RwLock , RwLockReadGuard , RwLockWriteGuard ,
@@ -525,8 +524,7 @@ mod dispatchers {
525
524
has_just_one : AtomicBool ,
526
525
}
527
526
528
- static LOCKED_DISPATCHERS : Lazy < RwLock < Vec < dispatcher:: Registrar > > > =
529
- Lazy :: new ( Default :: default) ;
527
+ static LOCKED_DISPATCHERS : RwLock < Vec < dispatcher:: Registrar > > = RwLock :: new ( Vec :: new ( ) ) ;
530
528
531
529
pub ( super ) enum Rebuilder < ' a > {
532
530
JustOne ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -261,8 +261,6 @@ macro_rules! metadata {
261
261
} ;
262
262
}
263
263
264
- pub ( crate ) mod lazy;
265
-
266
264
// Trimmed-down vendored version of spin 0.5.2 (0387621)
267
265
// Dependency of no_std lazy_static, not required in a std build
268
266
#[ cfg( not( feature = "std" ) ) ]
Original file line number Diff line number Diff line change @@ -64,11 +64,11 @@ mod no_std {
64
64
}
65
65
66
66
impl < T > Mutex < T > {
67
- // pub(crate) fn new(data: T) -> Self {
68
- // Self {
69
- // inner: crate::spin::Mutex::new(data),
70
- // }
71
- // }
67
+ pub ( crate ) const fn new ( data : T ) -> Self {
68
+ Self {
69
+ inner : crate :: spin:: Mutex :: new ( data) ,
70
+ }
71
+ }
72
72
73
73
pub ( crate ) fn lock ( & self ) -> Result < MutexGuard < ' _ , T > , ( ) > {
74
74
Ok ( self . inner . lock ( ) )
You can’t perform that action at this time.
0 commit comments