use std::error::Error;
use std::fmt;
#[derive(Debug)]
pub enum ImageCreationError {
InvalidColorComponentCount(usize),
}
impl fmt::Display for ImageCreationError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
ImageCreationError::InvalidColorComponentCount(count) => {
write!(f, "unsupported color component count (not 1-4): {}", count)
}
}
}
}
impl Error for ImageCreationError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
None
}
}