1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
use std::io::Error as IOError;
use crate::{XError, XErrorKind};
impl Default for XErrorKind {
fn default() -> Self {
XErrorKind::UnknownError
}
}
impl From<&IOError> for XErrorKind {
fn from(e: &IOError) -> Self {
XErrorKind::IOError(e.to_string())
}
}
impl From<IOError> for XError {
fn from(e: IOError) -> Self {
Self { kind: Box::new(XErrorKind::from(&e)), path: None, position: None, source: Some(Box::new(e)) }
}
}