quantizr 1.4.3

Fast library for converting RGBA images to 8-bit palette images
Documentation
use std::fmt;

#[non_exhaustive]
pub enum Error {
    /// The value provided to the fuction is out of allowed range
    ValueOutOfRange,
    /// The slice provided to the function is too small
    BufferTooSmall,
}

impl fmt::Display for Error {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::ValueOutOfRange => write!(f, "Value out of range"),
            Self::BufferTooSmall => write!(f, "Buffer is too small"),
        }
    }
}

impl fmt::Debug for Error {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self)
    }
}

impl std::error::Error for Error {}