diff --git a/src/stream.rs b/src/stream.rs index ad48769..87e4915 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -18,7 +18,7 @@ pub enum Stream { Tls(#[pin] T), } -impl AsyncRead for Stream { +impl AsyncRead for Stream { #[project] fn poll_read( self: Pin<&mut Self>, @@ -27,13 +27,13 @@ impl AsyncRead for Stream { ) -> Poll> { #[project] match self.project() { - Stream::Plain(ref mut s) => Pin::new(s).poll_read(cx, buf), - Stream::Tls(ref mut s) => Pin::new(s).poll_read(cx, buf), + Stream::Plain(s) => s.poll_read(cx, buf), + Stream::Tls(s) => s.poll_read(cx, buf), } } } -impl AsyncWrite for Stream { +impl AsyncWrite for Stream { #[project] fn poll_write( self: Pin<&mut Self>, @@ -42,8 +42,8 @@ impl AsyncWrite for Stream { ) -> Poll> { #[project] match self.project() { - Stream::Plain(ref mut s) => Pin::new(s).poll_write(cx, buf), - Stream::Tls(ref mut s) => Pin::new(s).poll_write(cx, buf), + Stream::Plain(s) => s.poll_write(cx, buf), + Stream::Tls(s) => s.poll_write(cx, buf), } } @@ -51,8 +51,8 @@ impl AsyncWrite for Stream { fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { #[project] match self.project() { - Stream::Plain(ref mut s) => Pin::new(s).poll_flush(cx), - Stream::Tls(ref mut s) => Pin::new(s).poll_flush(cx), + Stream::Plain(s) => s.poll_flush(cx), + Stream::Tls(s) => s.poll_flush(cx), } } @@ -63,8 +63,8 @@ impl AsyncWrite for Stream { ) -> Poll> { #[project] match self.project() { - Stream::Plain(ref mut s) => Pin::new(s).poll_shutdown(cx), - Stream::Tls(ref mut s) => Pin::new(s).poll_shutdown(cx), + Stream::Plain(s) => s.poll_shutdown(cx), + Stream::Tls(s) => s.poll_shutdown(cx), } } }