use core::fmt;
use std::error;
#[derive(Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum DecompressionError {
InvalidPrefix,
InputIsTooSmall,
DataExceedsMaxSize,
UnexpectedEof,
InvalidData,
}
impl fmt::Display for DecompressionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::InvalidPrefix => write!(f, "Invalid prefix"),
Self::InputIsTooSmall => write!(f, "Input is too small"),
Self::DataExceedsMaxSize => write!(f, "Compressed data exceeds max size"),
Self::UnexpectedEof => write!(f, "Unexpected EOF"),
Self::InvalidData => write!(f, "Invalid data"),
}
}
}
impl error::Error for DecompressionError {}