@@ -31,24 +31,35 @@ mod test_lockorder_checks;
31
31
#[ cfg( all( feature = "std" , any( ldk_bench, not( test) ) ) ) ]
32
32
pub ( crate ) mod fairrwlock;
33
33
#[ cfg( all( feature = "std" , any( ldk_bench, not( test) ) ) ) ]
34
- pub use { std:: sync:: { Arc , Mutex , Condvar , MutexGuard , RwLock , RwLockReadGuard , RwLockWriteGuard } , fairrwlock:: FairRwLock } ;
34
+ pub use {
35
+ fairrwlock:: FairRwLock ,
36
+ std:: sync:: { Arc , Condvar , Mutex , MutexGuard , RwLock , RwLockReadGuard , RwLockWriteGuard } ,
37
+ } ;
35
38
36
39
#[ cfg( all( feature = "std" , any( ldk_bench, not( test) ) ) ) ]
37
40
mod ext_impl {
38
41
use super :: * ;
39
42
impl < ' a , T : ' a > LockTestExt < ' a > for Mutex < T > {
40
43
#[ inline]
41
- fn held_by_thread ( & self ) -> LockHeldState { LockHeldState :: Unsupported }
44
+ fn held_by_thread ( & self ) -> LockHeldState {
45
+ LockHeldState :: Unsupported
46
+ }
42
47
type ExclLock = MutexGuard < ' a , T > ;
43
48
#[ inline]
44
- fn unsafe_well_ordered_double_lock_self ( & ' a self ) -> MutexGuard < T > { self . lock ( ) . unwrap ( ) }
49
+ fn unsafe_well_ordered_double_lock_self ( & ' a self ) -> MutexGuard < T > {
50
+ self . lock ( ) . unwrap ( )
51
+ }
45
52
}
46
53
impl < ' a , T : ' a > LockTestExt < ' a > for RwLock < T > {
47
54
#[ inline]
48
- fn held_by_thread ( & self ) -> LockHeldState { LockHeldState :: Unsupported }
55
+ fn held_by_thread ( & self ) -> LockHeldState {
56
+ LockHeldState :: Unsupported
57
+ }
49
58
type ExclLock = RwLockWriteGuard < ' a , T > ;
50
59
#[ inline]
51
- fn unsafe_well_ordered_double_lock_self ( & ' a self ) -> RwLockWriteGuard < T > { self . write ( ) . unwrap ( ) }
60
+ fn unsafe_well_ordered_double_lock_self ( & ' a self ) -> RwLockWriteGuard < T > {
61
+ self . write ( ) . unwrap ( )
62
+ }
52
63
}
53
64
}
54
65
0 commit comments