@@ -55,19 +55,32 @@ use util::chacha20::{ChaCha20, ChaChaReader};
55
55
use util:: logger:: Logger ;
56
56
use util:: errors:: APIError ;
57
57
58
- use std:: { cmp, mem} ;
58
+ #[ cfg( not( feature = "no_std" ) ) ]
59
+ use std:: {
60
+ cmp,
61
+ mem,
62
+ marker:: { Sync , Send } ,
63
+ ops:: Deref ,
64
+ sync:: atomic:: { AtomicUsize , Ordering } ,
65
+ time:: Duration ,
66
+ } ;
67
+ #[ cfg( feature = "no_std" ) ]
68
+ use core:: {
69
+ cmp,
70
+ mem,
71
+ marker:: { Sync , Send } ,
72
+ ops:: Deref ,
73
+ sync:: atomic:: { AtomicUsize , Ordering } ,
74
+ time:: Duration ,
75
+ } ;
59
76
#[ cfg( not( feature = "no_std" ) ) ]
60
77
use std:: collections:: { HashMap , hash_map, HashSet } ;
61
78
#[ cfg( feature = "no_std" ) ]
62
79
use hashbrown:: { HashMap , HashSet , hash_map} ;
63
80
use std:: io:: { Cursor , Read } ;
64
81
use std:: sync:: { Arc , Condvar , Mutex , MutexGuard , RwLock , RwLockReadGuard } ;
65
- use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
66
- use std:: time:: Duration ;
67
82
#[ cfg( any( test, feature = "allow_wallclock_use" ) ) ]
68
83
use std:: time:: Instant ;
69
- use std:: marker:: { Sync , Send } ;
70
- use std:: ops:: Deref ;
71
84
use bitcoin:: hashes:: hex:: ToHex ;
72
85
73
86
// We hold various information about HTLC relay in the HTLC objects in Channel itself:
@@ -4309,7 +4322,10 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
4309
4322
mod tests {
4310
4323
use ln:: channelmanager:: PersistenceNotifier ;
4311
4324
use std:: sync:: Arc ;
4325
+ #[ cfg( not( feature = "no_std" ) ) ]
4312
4326
use std:: sync:: atomic:: { AtomicBool , Ordering } ;
4327
+ #[ cfg( feature = "no_std" ) ]
4328
+ use core:: sync:: atomic:: { AtomicBool , Ordering } ;
4313
4329
use std:: thread;
4314
4330
use std:: time:: Duration ;
4315
4331
0 commit comments