From e59fb1dfc574b43e2cc527fbcb03bb8f8982473a Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 10 Sep 2024 19:15:54 +0500 Subject: [PATCH] wip --- ntex-glommio/src/io.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ntex-glommio/src/io.rs b/ntex-glommio/src/io.rs index 880f09f0..20c8e102 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.0.borrow_mut(), &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.0.borrow_mut()).poll_close(cx)).await + poll_fn(|cx| Pin::new(&mut *self.0 .0.borrow_mut()).poll_close(cx)).await } } @@ -123,7 +123,7 @@ pub(super) fn flush_io( // log::trace!("flushed {} bytes", written); // flush - return if written > 0 { + if written > 0 { match Pin::new(&mut *io).poll_flush(cx) { Poll::Ready(Ok(_)) => result, Poll::Pending => Poll::Pending, @@ -134,7 +134,7 @@ pub(super) fn flush_io( } } else { result - }; + } } else { Poll::Ready(Ok(())) } @@ -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.0.borrow_mut(), &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.0.borrow_mut()).poll_close(cx)).await + poll_fn(|cx| Pin::new(&mut *self.0 .0.borrow_mut()).poll_close(cx)).await } }