This commit is contained in:
Kornel 2025-05-21 00:02:16 +01:00 committed by Kornel
parent 9b34d3524b
commit 23863ffd1b
4 changed files with 5 additions and 9 deletions

View File

@ -541,7 +541,7 @@ fn run_command(command: &mut Command) -> io::Result<Output> {
None => format!("{:?} was terminated by signal", command),
};
return Err(io::Error::new(io::ErrorKind::Other, err));
return Err(io::Error::other(err));
}
Ok(out)

View File

@ -79,7 +79,7 @@ impl error::Error for ErrorStack {}
impl From<ErrorStack> for io::Error {
fn from(e: ErrorStack) -> io::Error {
io::Error::new(io::ErrorKind::Other, e)
io::Error::other(e)
}
}

View File

@ -3943,9 +3943,7 @@ impl<S: Read + Write> SslStream<S> {
}
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<S: Read + Write> Write for SslStream<S> {
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));
}
}
}

View File

@ -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)));
}
}