♻️ refactor: remove redundant var

main
_ 2021-10-10 18:12:36 +00:00
parent e8bb7ab098
commit baa5044186
1 changed files with 2 additions and 4 deletions

View File

@ -55,7 +55,7 @@ pub struct ForwardingParams {
pub async fn forward_port ( pub async fn forward_port (
connection_p2_p3: quinn::Connection, connection_p2_p3: quinn::Connection,
params: ForwardingParams, params: ForwardingParams,
shutdown_flag_rx: tokio::sync::watch::Receiver <bool>, mut shutdown_flag_rx: tokio::sync::watch::Receiver <bool>,
) -> anyhow::Result <()> ) -> anyhow::Result <()>
{ {
let ForwardingParams { let ForwardingParams {
@ -69,8 +69,6 @@ pub async fn forward_port (
trace! ("Accepting local TCP connections from P1 on {}", client_tcp_port); trace! ("Accepting local TCP connections from P1 on {}", client_tcp_port);
while *shutdown_flag_rx.borrow () { while *shutdown_flag_rx.borrow () {
let mut shutdown_flag_rx_2 = shutdown_flag_rx.clone ();
tokio::select! { tokio::select! {
x = listener.accept () => { x = listener.accept () => {
let (tcp_socket, _) = x?; let (tcp_socket, _) = x?;
@ -80,7 +78,7 @@ pub async fn forward_port (
tokio::spawn (handle_p1 (connection, server_id, server_tcp_port, tcp_socket, shutdown_flag_rx)); tokio::spawn (handle_p1 (connection, server_id, server_tcp_port, tcp_socket, shutdown_flag_rx));
}, },
_ = shutdown_flag_rx_2.changed () => (), _ = shutdown_flag_rx.changed () => (),
}; };
} }