You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
510 B

use std::io;
#[derive(Debug)]
pub enum UnpackError {
Io(io::Error),
Parsing(String),
Compression(String),
Naming(String),
Unknown(String),
}
impl UnpackError {
pub fn parsing_err(filetype: &str, kind: nom::error::ErrorKind) -> UnpackError {
let message = format!("{} parsing failed: {}", filetype, kind.description());
UnpackError::Parsing(message)
}
}
impl From<io::Error> for UnpackError {
fn from(e: io::Error) -> Self {
UnpackError::Io(e)
}
}