diff --git a/src/main.rs b/src/main.rs index f5926d2..61011ab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,7 +117,7 @@ async fn inner_handle_connection( // Insert the write part of this peer to the peer map. let (tx, rx) = unbounded(); - peer_map.lock().unwrap().insert(addr, tx.clone()); + { peer_map.lock().unwrap().insert(addr, tx.clone()); } let (outgoing, incoming) = ws_stream.split();