diff options
author | Carl Lerche <me@carllerche.com> | 2020-10-27 13:42:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 13:42:00 -0700 |
commit | d78655337a68bded305782a8a8b4ac7be42aa6a7 (patch) | |
tree | abbc3809ffe5966ef3bffc0fe3558613762d3aa4 /tokio-util/src/codec | |
parent | 38605c5c851551f52eb96b93be4f224588590111 (diff) |
Revert "util: upgrade tokio-util to bytes 0.6 (#3052)" (#3060)
This reverts commit fe2b997.
We are avoiding adding poll_read_buf to tokio itself for now. The patch is
reverted now in order to not block the v0.3.2 release (#3059).
Diffstat (limited to 'tokio-util/src/codec')
-rw-r--r-- | tokio-util/src/codec/framed_impl.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tokio-util/src/codec/framed_impl.rs b/tokio-util/src/codec/framed_impl.rs index ccb8b3c8..c161808f 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, AsyncReadExt, AsyncWrite}, + io::{AsyncRead, AsyncWrite}, stream::Stream, }; @@ -118,6 +118,8 @@ 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 { @@ -148,7 +150,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 pinned.inner.as_mut().poll_read_buf(&mut state.buffer, cx)? { + let bytect = match poll_read_buf(cx, pinned.inner.as_mut(), &mut state.buffer)? { Poll::Ready(ct) => ct, Poll::Pending => return Poll::Pending, }; |