use std::{fmt, io::Error as IoError, result::Result as StdResult};
#[derive(Debug)]
pub enum Error {
IO(IoError),
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::IO(io) => write!(f, "IO error: {}", io),
}
}
}
impl std::error::Error for Error {}
impl From<IoError> for Error {
fn from(err: IoError) -> Self {
Self::IO(err)
}
}
pub type Result<T = ()> = StdResult<T, Error>;
impl From<Error> for IoError {
fn from(value: Error) -> Self {
match value {
Error::IO(err) => err,
}
}
}