Cargo fmt

This commit is contained in:
Bastian Gruber 2023-04-30 21:43:08 +02:00
parent 319597ae30
commit 45981c53c7
No known key found for this signature in database
GPG key ID: BE9F8C772B188CBF
2 changed files with 3 additions and 5 deletions

View file

@ -36,7 +36,6 @@ impl Db {
.filter(|n| { .filter(|n| {
info!("{n} is in the room"); info!("{n} is in the room");
*n != username *n != username
}) })
.collect() .collect()
} }

View file

@ -80,9 +80,7 @@ impl Listener {
.unwrap(); .unwrap();
let socket = self.accept().await?; let socket = self.accept().await?;
let message_sender: let message_sender: broadcast::Sender<BroadcastMessage> =
broadcast::Sender<BroadcastMessage>
=
self.broadcast_message.clone(); self.broadcast_message.clone();
let mut handler = Handler { let mut handler = Handler {
@ -142,7 +140,8 @@ impl Handler {
// Broadcast the message "* USER has entered the room" // Broadcast the message "* USER has entered the room"
let joined_message = format!("* {username} has entered the room"); let joined_message = format!("* {username} has entered the room");
let _ = self.connection let _ = self
.connection
.broadcast_message(BroadcastMessage::new(username.clone(), joined_message)); .broadcast_message(BroadcastMessage::new(username.clone(), joined_message));
// Write back directly to the client which users are currently in the room // Write back directly to the client which users are currently in the room