1 | #![cfg_attr(docsrs, doc(cfg(feature = "std")))] |
---|---|
2 | extern crate std; |
3 | |
4 | use crate::Error; |
5 | use core::convert::From; |
6 | use std::io; |
7 | |
8 | impl From<Error> for io::Error { |
9 | fn from(err: Error) -> Self { |
10 | match err.raw_os_error() { |
11 | Some(errno: i32) => io::Error::from_raw_os_error(code:errno), |
12 | None => io::Error::new(kind:io::ErrorKind::Other, error:err), |
13 | } |
14 | } |
15 | } |
16 | |
17 | impl std::error::Error for Error {} |
18 |