We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f3ff15 commit 5d0cb4cCopy full SHA for 5d0cb4c
rand_core/src/error.rs
@@ -167,7 +167,11 @@ impl std::error::Error for Error {
167
impl From<Error> for std::io::Error {
168
#[inline]
169
fn from(error: Error) -> Self {
170
- std::io::Error::new(std::io::ErrorKind::Other, error)
+ if let Some(code) = error.raw_os_error() {
171
+ std::io::Error::from_raw_os_error(code)
172
+ } else {
173
+ std::io::Error::new(std::io::ErrorKind::Other, error)
174
+ }
175
}
176
177
0 commit comments