summaryrefslogtreecommitdiffstats
path: root/tokio-util/src/io
diff options
context:
space:
mode:
authorDirkjan Ochtman <dirkjan@ochtman.nl>2020-11-01 10:22:22 +0100
committerGitHub <noreply@github.com>2020-11-01 10:22:22 +0100
commit2b23aa7389686f341e564c8da565a3b4c8b1188f (patch)
tree8cdaae52b9afb1e1a5b2f2fde6d403e56350267e /tokio-util/src/io
parent382ee6bf5ddc45f62fd5faf1428d7f193c9e8ad8 (diff)
util: add back public poll_read_buf() function (#3079)
This was accidentally removed in #3064.
Diffstat (limited to 'tokio-util/src/io')
-rw-r--r--tokio-util/src/io/mod.rs1
-rw-r--r--tokio-util/src/io/read_buf.rs2
-rw-r--r--tokio-util/src/io/reader_stream.rs2
3 files changed, 3 insertions, 2 deletions
diff --git a/tokio-util/src/io/mod.rs b/tokio-util/src/io/mod.rs
index 6f181ab1..eefd65a5 100644
--- a/tokio-util/src/io/mod.rs
+++ b/tokio-util/src/io/mod.rs
@@ -13,3 +13,4 @@ mod stream_reader;
pub use self::read_buf::read_buf;
pub use self::reader_stream::ReaderStream;
pub use self::stream_reader::StreamReader;
+pub use crate::util::poll_read_buf;
diff --git a/tokio-util/src/io/read_buf.rs b/tokio-util/src/io/read_buf.rs
index 5bc0d586..cc3c505f 100644
--- a/tokio-util/src/io/read_buf.rs
+++ b/tokio-util/src/io/read_buf.rs
@@ -59,7 +59,7 @@ where
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = &mut *self;
- crate::util::poll_read_buf(cx, Pin::new(this.0), this.1)
+ crate::util::poll_read_buf(Pin::new(this.0), cx, this.1)
}
}
}
diff --git a/tokio-util/src/io/reader_stream.rs b/tokio-util/src/io/reader_stream.rs
index ab0c22fb..3e6a05ef 100644
--- a/tokio-util/src/io/reader_stream.rs
+++ b/tokio-util/src/io/reader_stream.rs
@@ -83,7 +83,7 @@ impl<R: AsyncRead> Stream for ReaderStream<R> {
this.buf.reserve(CAPACITY);
}
- match poll_read_buf(cx, reader, &mut this.buf) {
+ match poll_read_buf(reader, cx, &mut this.buf) {
Poll::Pending => Poll::Pending,
Poll::Ready(Err(err)) => {
self.project().reader.set(None);