From d2db7ede027f72c632b909381c262c5d38d03be8 Mon Sep 17 00:00:00 2001 From: Andreas Brekken Date: Sat, 17 Aug 2024 12:45:38 +0700 Subject: [PATCH] refactor, clippy --- src/ws/robust/subs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ws/robust/subs.rs b/src/ws/robust/subs.rs index b1ebce1..67a2b04 100644 --- a/src/ws/robust/subs.rs +++ b/src/ws/robust/subs.rs @@ -89,7 +89,7 @@ impl Subs { debug!("Adding sub with id: {} ({})", id, topic_key); - if subs.iter().find(|s| s.topic_key == topic_key).is_none() { + if !subs.iter().any(|s| s.topic_key == topic_key) { debug!("First subscription for this topic, sending subscribe command"); Stream::send_command( @@ -125,7 +125,7 @@ impl Subs { subs.retain(|s| s.id != sub_id); // Send unsub if no subs have topic_key of token.topic_key anymore - if subs.iter().find(|s| s.topic_key == topic_key).is_none() { + if !subs.iter().any(|s| s.topic_key == topic_key) { debug!( "Last subscriber removed. Sending unsubscribe for topic: {}", topic_key