mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
util: add back public poll_read_buf() function (#3079)
This was accidentally removed in #3064.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user