diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-10-27 09:30:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 09:30:29 +0100 |
commit | fe2b9976755407b85c82b5cdee9d8c5e16e3d6c6 (patch) | |
tree | 65d9278870691e102cbcc8122782fe75104d2894 /tokio-util/src/codec/framed_impl.rs | |
parent | 6d0ba19af51015dcd80558ae768215448e285fdf (diff) |
util: upgrade tokio-util to bytes 0.6 (#3052)
Diffstat (limited to 'tokio-util/src/codec/framed_impl.rs')
-rw-r--r-- | tokio-util/src/codec/framed_impl.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tokio-util/src/codec/framed_impl.rs b/tokio-util/src/codec/framed_impl.rs index c161808f..ccb8b3c8 100644 --- a/tokio-util/src/codec/framed_impl.rs +++ b/tokio-util/src/codec/framed_impl.rs @@ -2,7 +2,7 @@ use crate::codec::decoder::Decoder; use crate::codec::encoder::Encoder; use tokio::{ - io::{AsyncRead, AsyncWrite}, + io::{AsyncRead, AsyncReadExt, AsyncWrite}, stream::Stream, }; @@ -118,8 +118,6 @@ where type Item = Result<U::Item, U::Error>; fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> { - use crate::util::poll_read_buf; - let mut pinned = self.project(); let state: &mut ReadFrame = pinned.state.borrow_mut(); loop { @@ -150,7 +148,7 @@ where // got room for at least one byte to read to ensure that we don't // get a spurious 0 that looks like EOF state.buffer.reserve(1); - let bytect = match poll_read_buf(cx, pinned.inner.as_mut(), &mut state.buffer)? { + let bytect = match pinned.inner.as_mut().poll_read_buf(&mut state.buffer, cx)? { Poll::Ready(ct) => ct, Poll::Pending => return Poll::Pending, }; |