diff --git a/boring-sys/build/main.rs b/boring-sys/build/main.rs index 0f0b94c1..e14b932f 100644 --- a/boring-sys/build/main.rs +++ b/boring-sys/build/main.rs @@ -541,7 +541,7 @@ fn run_command(command: &mut Command) -> io::Result { None => format!("{:?} was terminated by signal", command), }; - return Err(io::Error::new(io::ErrorKind::Other, err)); + return Err(io::Error::other(err)); } Ok(out) diff --git a/boring/src/error.rs b/boring/src/error.rs index 9cdc878b..1f951341 100644 --- a/boring/src/error.rs +++ b/boring/src/error.rs @@ -79,7 +79,7 @@ impl error::Error for ErrorStack {} impl From for io::Error { fn from(e: ErrorStack) -> io::Error { - io::Error::new(io::ErrorKind::Other, e) + io::Error::other(e) } } diff --git a/boring/src/ssl/mod.rs b/boring/src/ssl/mod.rs index e1253e3b..762cb2d7 100644 --- a/boring/src/ssl/mod.rs +++ b/boring/src/ssl/mod.rs @@ -3943,9 +3943,7 @@ impl SslStream { } Err(ref e) if e.code() == ErrorCode::WANT_READ && e.io_error().is_none() => {} Err(e) => { - return Err(e - .into_io_error() - .unwrap_or_else(|e| io::Error::new(io::ErrorKind::Other, e))); + return Err(e.into_io_error().unwrap_or_else(io::Error::other)); } } } @@ -4167,9 +4165,7 @@ impl Write for SslStream { Ok(n) => return Ok(n), Err(ref e) if e.code() == ErrorCode::WANT_READ && e.io_error().is_none() => {} Err(e) => { - return Err(e - .into_io_error() - .unwrap_or_else(|e| io::Error::new(io::ErrorKind::Other, e))); + return Err(e.into_io_error().unwrap_or_else(io::Error::other)); } } } diff --git a/tokio-boring/src/lib.rs b/tokio-boring/src/lib.rs index f1593ed8..d0d1502e 100644 --- a/tokio-boring/src/lib.rs +++ b/tokio-boring/src/lib.rs @@ -242,7 +242,7 @@ where Err(e) => { return Poll::Ready(Err(e .into_io_error() - .unwrap_or_else(|e| io::Error::new(io::ErrorKind::Other, e)))); + .unwrap_or_else(io::Error::other))); } }