Skip to content

Commit d8ffc8f

Browse files
io: replace Result<T, io::Error> with io::Result<T> in AsyncWrite
1 parent 4714ca1 commit d8ffc8f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tokio/src/io/async_write.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub trait AsyncWrite {
5454
self: Pin<&mut Self>,
5555
cx: &mut Context<'_>,
5656
buf: &[u8],
57-
) -> Poll<Result<usize, io::Error>>;
57+
) -> Poll<io::Result<usize>>;
5858

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

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

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

0 commit comments

Comments
 (0)