diff options
author | Carl Lerche <me@carllerche.com> | 2020-09-24 17:26:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-24 17:26:03 -0700 |
commit | 4186b0aa38abbec7670d53882d5cdfd4b12add5c (patch) | |
tree | b067117fcb1a4c479cd274465bcac0431c2e59f7 /tokio-test | |
parent | 760ae89401d9addb71ebf19674980577b5501edd (diff) |
io: remove poll_{read,write}_buf from traits (#2882)
These functions have object safety issues. It also has been decided to
avoid vectored operations on the I/O traits. A later PR will bring back
vectored operations on specific types that support them.
Refs: #2879, #2716
Diffstat (limited to 'tokio-test')
-rw-r--r-- | tokio-test/src/io.rs | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/tokio-test/src/io.rs b/tokio-test/src/io.rs index ac70a06f..4f0b5897 100644 --- a/tokio-test/src/io.rs +++ b/tokio-test/src/io.rs @@ -22,7 +22,6 @@ use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use tokio::sync::mpsc; use tokio::time::{self, Delay, Duration, Instant}; -use bytes::Buf; use futures_core::ready; use std::collections::VecDeque; use std::future::Future; @@ -439,16 +438,6 @@ impl AsyncWrite for Mock { } } - fn poll_write_buf<B: Buf>( - self: Pin<&mut Self>, - cx: &mut task::Context<'_>, - buf: &mut B, - ) -> Poll<io::Result<usize>> { - let n = ready!(self.poll_write(cx, buf.bytes()))?; - buf.advance(n); - Poll::Ready(Ok(n)) - } - fn poll_flush(self: Pin<&mut Self>, _cx: &mut task::Context<'_>) -> Poll<io::Result<()>> { Poll::Ready(Ok(())) } |