File tree Expand file tree Collapse file tree 5 files changed +9
-90
lines changed Expand file tree Collapse file tree 5 files changed +9
-90
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,12 @@ rust-version = "1.65.0"
2626
2727[features ]
2828default = [" std" , " valuable?/std" ]
29- std = [" once_cell " ]
29+ std = []
3030
3131[badges ]
3232maintenance = { status = " actively-developed" }
3333
3434[dependencies ]
35- once_cell = { version = " 1.13.0" , optional = true }
3635
3736[target .'cfg(tracing_unstable)' .dependencies ]
3837valuable = { 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::{
109109} ;
110110use crate :: {
111111 dispatcher:: Dispatch ,
112- lazy:: Lazy ,
113112 metadata:: { LevelFilter , Metadata } ,
114113 subscriber:: Interest ,
115114} ;
@@ -260,7 +259,7 @@ static CALLSITES: Callsites = Callsites {
260259
261260static DISPATCHERS : Dispatchers = Dispatchers :: new ( ) ;
262261
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 ( ) ) ;
264263
265264struct Callsites {
266265 list_head : AtomicPtr < DefaultCallsite > ,
@@ -515,7 +514,7 @@ mod private {
515514
516515#[ cfg( feature = "std" ) ]
517516mod dispatchers {
518- use crate :: { dispatcher, lazy :: Lazy } ;
517+ use crate :: dispatcher;
519518 use std:: sync:: {
520519 atomic:: { AtomicBool , Ordering } ,
521520 RwLock , RwLockReadGuard , RwLockWriteGuard ,
@@ -525,8 +524,7 @@ mod dispatchers {
525524 has_just_one : AtomicBool ,
526525 }
527526
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 ( ) ) ;
530528
531529 pub ( super ) enum Rebuilder < ' a > {
532530 JustOne ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -261,8 +261,6 @@ macro_rules! metadata {
261261 } ;
262262}
263263
264- pub ( crate ) mod lazy;
265-
266264// Trimmed-down vendored version of spin 0.5.2 (0387621)
267265// Dependency of no_std lazy_static, not required in a std build
268266#[ cfg( not( feature = "std" ) ) ]
Original file line number Diff line number Diff line change @@ -64,11 +64,11 @@ mod no_std {
6464 }
6565
6666 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+ }
7272
7373 pub ( crate ) fn lock ( & self ) -> Result < MutexGuard < ' _ , T > , ( ) > {
7474 Ok ( self . inner . lock ( ) )
You can’t perform that action at this time.
0 commit comments