Skip to content

Commit

Permalink
refactor, clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
abrkn committed Aug 17, 2024
1 parent 76747ca commit d2db7ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ws/robust/subs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d2db7ed

Please sign in to comment.