Skip to content

Commit bd9834a

Browse files
core/either: Use io::Result type alias instead of renaming io::Error (#2687)
1 parent c36a749 commit bd9834a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

core/src/either.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use futures::{
2828
prelude::*,
2929
};
3030
use pin_project::pin_project;
31-
use std::{fmt, io::Error as IoError, pin::Pin, task::Context, task::Poll};
31+
use std::{fmt, io, pin::Pin, task::Context, task::Poll};
3232

3333
#[derive(Debug, Copy, Clone)]
3434
pub enum EitherError<A, B> {
@@ -80,7 +80,7 @@ where
8080
self: Pin<&mut Self>,
8181
cx: &mut Context<'_>,
8282
buf: &mut [u8],
83-
) -> Poll<Result<usize, IoError>> {
83+
) -> Poll<io::Result<usize>> {
8484
match self.project() {
8585
EitherOutputProj::First(a) => AsyncRead::poll_read(a, cx, buf),
8686
EitherOutputProj::Second(b) => AsyncRead::poll_read(b, cx, buf),
@@ -91,7 +91,7 @@ where
9191
self: Pin<&mut Self>,
9292
cx: &mut Context<'_>,
9393
bufs: &mut [IoSliceMut<'_>],
94-
) -> Poll<Result<usize, IoError>> {
94+
) -> Poll<io::Result<usize>> {
9595
match self.project() {
9696
EitherOutputProj::First(a) => AsyncRead::poll_read_vectored(a, cx, bufs),
9797
EitherOutputProj::Second(b) => AsyncRead::poll_read_vectored(b, cx, bufs),
@@ -108,7 +108,7 @@ where
108108
self: Pin<&mut Self>,
109109
cx: &mut Context<'_>,
110110
buf: &[u8],
111-
) -> Poll<Result<usize, IoError>> {
111+
) -> Poll<io::Result<usize>> {
112112
match self.project() {
113113
EitherOutputProj::First(a) => AsyncWrite::poll_write(a, cx, buf),
114114
EitherOutputProj::Second(b) => AsyncWrite::poll_write(b, cx, buf),
@@ -119,21 +119,21 @@ where
119119
self: Pin<&mut Self>,
120120
cx: &mut Context<'_>,
121121
bufs: &[IoSlice<'_>],
122-
) -> Poll<Result<usize, IoError>> {
122+
) -> Poll<io::Result<usize>> {
123123
match self.project() {
124124
EitherOutputProj::First(a) => AsyncWrite::poll_write_vectored(a, cx, bufs),
125125
EitherOutputProj::Second(b) => AsyncWrite::poll_write_vectored(b, cx, bufs),
126126
}
127127
}
128128

129-
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), IoError>> {
129+
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
130130
match self.project() {
131131
EitherOutputProj::First(a) => AsyncWrite::poll_flush(a, cx),
132132
EitherOutputProj::Second(b) => AsyncWrite::poll_flush(b, cx),
133133
}
134134
}
135135

136-
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), IoError>> {
136+
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
137137
match self.project() {
138138
EitherOutputProj::First(a) => AsyncWrite::poll_close(a, cx),
139139
EitherOutputProj::Second(b) => AsyncWrite::poll_close(b, cx),
@@ -203,7 +203,7 @@ where
203203
{
204204
type Substream = EitherOutput<A::Substream, B::Substream>;
205205
type OutboundSubstream = EitherOutbound<A, B>;
206-
type Error = IoError;
206+
type Error = io::Error;
207207

208208
fn poll_event(
209209
&self,

0 commit comments

Comments
 (0)