1extern crate std; 2 3use crate::Error; 4use std::io; 5 6impl From<Error> for io::Error { 7 fn from(err: Error) -> Self { 8 match err.raw_os_error() { 9 Some(errno) => io::Error::from_raw_os_error(errno), 10 None => io::Error::other(err), 11 } 12 } 13}