Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tokio/src/io/async_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub trait AsyncWrite {
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, io::Error>>;
) -> Poll<io::Result<usize>>;

/// Attempts to flush the object, ensuring that any buffered data reach
/// their destination.
Expand All @@ -65,7 +65,7 @@ pub trait AsyncWrite {
/// `Poll::Pending` and arranges for the current task (via
/// `cx.waker()`) to receive a notification when the object can make
/// progress towards flushing.
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), io::Error>>;
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>>;

/// Initiates or attempts to shut down this writer, returning success when
/// the I/O connection has completely shut down.
Expand Down Expand Up @@ -125,7 +125,7 @@ pub trait AsyncWrite {
///
/// This function will panic if not called within the context of a future's
/// task.
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), io::Error>>;
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>>;

/// Like [`poll_write`], except that it writes from a slice of buffers.
///
Expand Down Expand Up @@ -154,7 +154,7 @@ pub trait AsyncWrite {
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize, io::Error>> {
) -> Poll<io::Result<usize>> {
let buf = bufs
.iter()
.find(|b| !b.is_empty())
Expand Down