#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DecodeError {
UnexpectedEof,
InvalidCode,
Overflow,
}
impl core::fmt::Display for DecodeError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Self::UnexpectedEof => write!(f, "unexpected end of input"),
Self::InvalidCode => write!(f, "invalid CCITT code sequence"),
Self::Overflow => write!(f, "arithmetic overflow in position calculation"),
}
}
}
impl core::error::Error for DecodeError {}
pub type Result<T> = core::result::Result<T, DecodeError>;