From 72f321bdb320c49f3681132fa616e4318bda9039 Mon Sep 17 00:00:00 2001 From: Clover Johnson <95094165+callmeclover@users.noreply.github.com> Date: Mon, 29 Apr 2024 09:08:29 -0400 Subject: [PATCH] fix 2 --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7d395139..066d6d47 100644 --- a/src/main.rs +++ b/src/main.rs @@ -166,7 +166,7 @@ async fn handle_socket(socket: WebSocket, _who: SocketAddr, state: Arc }, MessageTypes::UserJoin(request) => { user_recv.lock().unwrap().name = request.user; - user_set_recv.lock().unwrap().push(user_recv.lock().unwrap().name.clone()); + user_set_recv.lock().unwrap().insert(user_recv.lock().unwrap().name.clone()); let _ = tx.send( serde_json::to_string(&(UserJoin { user: user_recv.lock().unwrap().name.clone() })).expect("") );