diff options
Diffstat (limited to 'src/error_impls.rs')
-rw-r--r-- | src/error_impls.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/error_impls.rs b/src/error_impls.rs index 007472e..61f46d2 100644 --- a/src/error_impls.rs +++ b/src/error_impls.rs @@ -5,24 +5,13 @@ // <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. +#![cfg_attr(docsrs, doc(cfg(feature = "std")))] extern crate std; -use crate::{error::UNKNOWN_IO_ERROR, Error}; +use crate::Error; use core::convert::From; -use core::num::NonZeroU32; use std::io; -impl From<io::Error> for Error { - fn from(err: io::Error) -> Self { - if let Some(errno) = err.raw_os_error() { - if let Some(code) = NonZeroU32::new(errno as u32) { - return Error::from(code); - } - } - UNKNOWN_IO_ERROR - } -} - impl From<Error> for io::Error { fn from(err: Error) -> Self { match err.raw_os_error() { |