mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-19 00:00:09 +02:00
io: replace Result<T, io::Error> with io::Result<T> in AsyncWrite (#7740)
This commit is contained in:
@@ -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.
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
///
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user