Skip to content

Commit

Permalink
Use is_some() instead of unused assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
WhyNotHugo authored and pr2502 committed Oct 25, 2023
1 parent 496402f commit 526d58a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Instance {
}

pub async fn add_client(&self, port: u16, channel: mpsc::Sender<Message>) {
if let Some(_) = self.clients.lock().await.insert(port, channel) {
if self.clients.lock().await.insert(port, channel).is_some() {
unreachable!("BUG: added two clients with the same port");
}
}
Expand Down

0 comments on commit 526d58a

Please sign in to comment.