Cargo fmt
This commit is contained in:
parent
319597ae30
commit
45981c53c7
2 changed files with 3 additions and 5 deletions
|
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue