From 0bb9fb1ad0412a9b20fc7424c3ad1d35c6089b09 Mon Sep 17 00:00:00 2001 From: jake Date: Thu, 13 Aug 2020 18:24:17 -0600 Subject: [PATCH] no need to set this to a var --- src/common/mainloop.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/common/mainloop.rs b/src/common/mainloop.rs index 0439e0f..09cb6a7 100644 --- a/src/common/mainloop.rs +++ b/src/common/mainloop.rs @@ -382,7 +382,7 @@ where R: RecvServerPacket + std::fmt::Debug + Send + Sync + 'static, E: std::fmt::Debug + Send, { - let listener = async_std::task::spawn(async move { + async_std::task::spawn(async move { let listener = async_std::net::TcpListener::bind(&std::net::SocketAddr::from((std::net::Ipv4Addr::new(0,0,0,0), client_port))).await.unwrap(); let mut id = 1; @@ -405,9 +405,7 @@ where client_recv_loop(client_id, socket.clone(), cipher_in.clone(), server_state_sender.clone(), client_sender).await; client_send_loop(client_id, socket.clone(), cipher_in.clone(), cipher_out.clone(), client_receiver).await; } - }); - - listener + }) }