Skip to content

Commit

Permalink
message_bus: fix clippy issue (#8)
Browse files Browse the repository at this point in the history
simplify the code slightly to remove the single clippy issue.
  • Loading branch information
forslund authored Nov 17, 2024
1 parent bea93a5 commit 27061bb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/message_bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ impl MessageBus {

async fn broadcast_message(&self, message: &str) {
let mut connections = self.connections.lock().unwrap();
connections.retain(|tx| match tx.send(Message::Text(message.to_string())) {
Ok(_) => true,
Err(_) => false,
});
connections.retain(|tx| tx.send(Message::Text(message.to_string())).is_ok());
}

async fn remove_connection(&self, tx: &UnboundedSender<Message>) {
Expand Down

0 comments on commit 27061bb

Please sign in to comment.