diff --git a/tokio-tls/src/lib.rs b/tokio-tls/src/lib.rs index 1af689f9d..2b131ceca 100644 --- a/tokio-tls/src/lib.rs +++ b/tokio-tls/src/lib.rs @@ -287,7 +287,7 @@ impl TlsConnector { where S: AsyncRead + AsyncWrite + Unpin, { - handshake(|s| self.0.connect(domain, s), stream).await + handshake(move |s| self.0.connect(domain, s), stream).await } } @@ -318,7 +318,7 @@ impl TlsAcceptor { where S: AsyncRead + AsyncWrite + Unpin, { - handshake(|s| self.0.accept(s), stream).await + handshake(move |s| self.0.accept(s), stream).await } }