From 61b7609fbb9e28c103637d378398afef47c54cc0 Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Thu, 26 Dec 2024 16:49:08 -0600 Subject: [PATCH] fix: Remove redundant pinning of futures in connection handler --- crates/core/src/transport/connection_handler.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/core/src/transport/connection_handler.rs b/crates/core/src/transport/connection_handler.rs index a7f970b7a..bb415b2f7 100644 --- a/crates/core/src/transport/connection_handler.rs +++ b/crates/core/src/transport/connection_handler.rs @@ -291,8 +291,7 @@ impl UdpPacketsListener { let task = tokio::spawn({ let span = tracing::span!(tracing::Level::DEBUG, "gateway_connection"); async move { - let pinned = Box::pin(gw_ongoing_connection); - match pinned.await { + match gw_ongoing_connection.await { Ok(result) => Ok(result), Err(error) => Err((error, remote_addr)) } @@ -381,8 +380,7 @@ impl UdpPacketsListener { let task = tokio::spawn({ let span = span!(tracing::Level::DEBUG, "traverse_nat"); async move { - let pinned = Box::pin(ongoing_connection); - match pinned.await { + match ongoing_connection.await { Ok(result) => Ok(result), Err(error) => Err((error, remote_addr)) }