use std::error::Error; use std::fmt::{Debug, Display}; use std::io; pub type ArchiveResult = Result; #[derive(Debug)] pub enum ArchiveError { IO(io::Error), } impl From for ArchiveError { fn from(value: io::Error) -> Self { Self::IO(value) } } impl Display for ArchiveError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::IO(err) => write!(f, "{err}"), } } } impl Error for ArchiveError { fn source(&self) -> Option<&(dyn Error + 'static)> { match self { Self::IO(source) => Some(source), } } }