From 45981c53c777b8347c295eca17c1b79a39fe531a Mon Sep 17 00:00:00 2001 From: Bastian Gruber Date: Sun, 30 Apr 2023 21:43:08 +0200 Subject: [PATCH] Cargo fmt --- problem_03/src/db.rs | 1 - problem_03/src/server.rs | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/problem_03/src/db.rs b/problem_03/src/db.rs index 76fe96e..ae46bbc 100644 --- a/problem_03/src/db.rs +++ b/problem_03/src/db.rs @@ -36,7 +36,6 @@ impl Db { .filter(|n| { info!("{n} is in the room"); *n != username - }) .collect() } diff --git a/problem_03/src/server.rs b/problem_03/src/server.rs index bfb855f..23bfc33 100644 --- a/problem_03/src/server.rs +++ b/problem_03/src/server.rs @@ -80,9 +80,7 @@ impl Listener { .unwrap(); let socket = self.accept().await?; - let message_sender: - broadcast::Sender - = + let message_sender: broadcast::Sender = self.broadcast_message.clone(); let mut handler = Handler { @@ -142,7 +140,8 @@ impl Handler { // Broadcast the message "* USER 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)); // Write back directly to the client which users are currently in the room