diff --git a/ntex-glommio/src/io.rs b/ntex-glommio/src/io.rs index b6b67a7a..880f09f0 100644 --- a/ntex-glommio/src/io.rs +++ b/ntex-glommio/src/io.rs @@ -61,7 +61,7 @@ struct Write(TcpStream); impl ntex_io::AsyncWrite for Write { #[inline] async fn write(&mut self, mut buf: BytesVec) -> (BytesVec, io::Result<()>) { - match lazy(|cx| flush_io(&mut self.0, &mut buf, cx)).await { + match lazy(|cx| flush_io(&mut *self.0.0.borrow_mut(), &mut buf, cx)).await { Poll::Ready(res) => (buf, res), Poll::Pending => (buf, Ok(())), } @@ -74,7 +74,7 @@ impl ntex_io::AsyncWrite for Write { #[inline] async fn shutdown(&mut self) -> io::Result<()> { - poll_fn(|cx| Pin::new(&mut self.0).poll_close(cx)).await + poll_fn(|cx| Pin::new(&mut *self.0.0.borrow_mut()).poll_close(cx)).await } } @@ -176,7 +176,7 @@ struct UnixWrite(UnixStream); impl ntex_io::AsyncWrite for UnixWrite { #[inline] async fn write(&mut self, mut buf: BytesVec) -> (BytesVec, io::Result<()>) { - match lazy(|cx| flush_io(&mut self.0, &mut buf, cx)).await { + match lazy(|cx| flush_io(&mut *self.0.0.borrow_mut(), &mut buf, cx)).await { Poll::Ready(res) => (buf, res), Poll::Pending => (buf, Ok(())), } @@ -189,6 +189,6 @@ impl ntex_io::AsyncWrite for UnixWrite { #[inline] async fn shutdown(&mut self) -> io::Result<()> { - poll_fn(|cx| Pin::new(&mut self.0).poll_close(cx)).await + poll_fn(|cx| Pin::new(&mut *self.0.0.borrow_mut()).poll_close(cx)).await } }