File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
crates/nostr-relay-pool/src/relay Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -430,7 +430,7 @@ impl InnerRelay {
430
430
let subscriptions = self . atomic . subscriptions . read ( ) . await ;
431
431
432
432
// No sleep if there are active subscriptions
433
- if subscriptions. len ( ) > 0 {
433
+ if ! subscriptions. is_empty ( ) {
434
434
return false ;
435
435
}
436
436
Original file line number Diff line number Diff line change @@ -359,16 +359,17 @@ mod tests {
359
359
#[ test]
360
360
fn test_close ( ) {
361
361
let opts = SubscribeOptions :: default ( ) ;
362
- assert_eq ! ( opts. is_auto_closing( ) , false ) ;
362
+ assert ! ( ! opts. is_auto_closing( ) ) ;
363
363
let opts = SubscribeOptions :: default ( ) . close_on ( Some ( SubscribeAutoCloseOptions :: default ( ) ) ) ;
364
- assert_eq ! ( opts. is_auto_closing( ) , true ) ;
364
+ assert ! ( opts. is_auto_closing( ) ) ;
365
365
}
366
366
367
367
#[ test]
368
368
fn test_sync_progress_percentage ( ) {
369
- let mut sp = SyncProgress :: default ( ) ;
370
- sp. total = 5 ;
371
- sp. current = 2 ;
369
+ let sp = SyncProgress {
370
+ total : 5 ,
371
+ current : 2 ,
372
+ } ;
372
373
assert_eq ! ( sp. percentage( ) , 2f64 / 5f64 ) ;
373
374
let sp_zero = SyncProgress :: default ( ) ;
374
375
assert_eq ! ( sp_zero. percentage( ) , 0.0 ) ;
You can’t perform that action at this time.
0 commit comments