use core::fmt;
#[cfg(feature = "std")]
use std::error::Error;
#[derive(Debug)]
#[non_exhaustive]
pub enum ParseError {
BadMagic,
ZeroWidth,
ZeroFaceCount,
UnexpectedEnd,
}
#[cfg(feature = "std")]
impl Error for ParseError {}
impl fmt::Display for ParseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match &self {
ParseError::BadMagic => f.pad("unexpected magic numbers"),
ParseError::ZeroWidth => f.pad("zero pixel width"),
ParseError::ZeroFaceCount => f.pad("zero face count"),
ParseError::UnexpectedEnd => f.pad("unexpected end of buffer"),
}
}
}