Skip to content

Commit 2eb8483

Browse files
committed
relay-pool: Fix warning lints
Signed-off-by: Awiteb <[email protected]>
1 parent 56d27a1 commit 2eb8483

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

crates/nostr-relay-pool/src/relay/inner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ impl InnerRelay {
430430
let subscriptions = self.atomic.subscriptions.read().await;
431431

432432
// No sleep if there are active subscriptions
433-
if subscriptions.len() > 0 {
433+
if !subscriptions.is_empty() {
434434
return false;
435435
}
436436

crates/nostr-relay-pool/src/relay/options.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,16 +359,17 @@ mod tests {
359359
#[test]
360360
fn test_close() {
361361
let opts = SubscribeOptions::default();
362-
assert_eq!(opts.is_auto_closing(), false);
362+
assert!(!opts.is_auto_closing());
363363
let opts = SubscribeOptions::default().close_on(Some(SubscribeAutoCloseOptions::default()));
364-
assert_eq!(opts.is_auto_closing(), true);
364+
assert!(opts.is_auto_closing());
365365
}
366366

367367
#[test]
368368
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+
};
372373
assert_eq!(sp.percentage(), 2f64 / 5f64);
373374
let sp_zero = SyncProgress::default();
374375
assert_eq!(sp_zero.percentage(), 0.0);

0 commit comments

Comments
 (0)