diff --git a/core/src/either.rs b/core/src/either.rs index 1d0121e860e..e1c5316fd6a 100644 --- a/core/src/either.rs +++ b/core/src/either.rs @@ -28,7 +28,7 @@ use futures::{ prelude::*, }; use pin_project::pin_project; -use std::{fmt, io::Error as IoError, pin::Pin, task::Context, task::Poll}; +use std::{fmt, io, pin::Pin, task::Context, task::Poll}; #[derive(Debug, Copy, Clone)] pub enum EitherError { @@ -80,7 +80,7 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8], - ) -> Poll> { + ) -> Poll> { match self.project() { EitherOutputProj::First(a) => AsyncRead::poll_read(a, cx, buf), EitherOutputProj::Second(b) => AsyncRead::poll_read(b, cx, buf), @@ -91,7 +91,7 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &mut [IoSliceMut<'_>], - ) -> Poll> { + ) -> Poll> { match self.project() { EitherOutputProj::First(a) => AsyncRead::poll_read_vectored(a, cx, bufs), EitherOutputProj::Second(b) => AsyncRead::poll_read_vectored(b, cx, bufs), @@ -108,7 +108,7 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], - ) -> Poll> { + ) -> Poll> { match self.project() { EitherOutputProj::First(a) => AsyncWrite::poll_write(a, cx, buf), EitherOutputProj::Second(b) => AsyncWrite::poll_write(b, cx, buf), @@ -119,21 +119,21 @@ where self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], - ) -> Poll> { + ) -> Poll> { match self.project() { EitherOutputProj::First(a) => AsyncWrite::poll_write_vectored(a, cx, bufs), EitherOutputProj::Second(b) => AsyncWrite::poll_write_vectored(b, cx, bufs), } } - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { match self.project() { EitherOutputProj::First(a) => AsyncWrite::poll_flush(a, cx), EitherOutputProj::Second(b) => AsyncWrite::poll_flush(b, cx), } } - fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { match self.project() { EitherOutputProj::First(a) => AsyncWrite::poll_close(a, cx), EitherOutputProj::Second(b) => AsyncWrite::poll_close(b, cx), @@ -203,7 +203,7 @@ where { type Substream = EitherOutput; type OutboundSubstream = EitherOutbound; - type Error = IoError; + type Error = io::Error; fn poll_event( &self,