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