use core::fmt;
use core::fmt::Display;
use std::error::Error;
#[derive(Debug, PartialEq)]
pub enum SlabbableError {
AtCapacity(usize),
InvalidIndex(usize),
Bug(&'static str),
}
impl Display for SlabbableError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::AtCapacity(s) => write!(f, "At maximum fixed capacity: {}", s),
Self::InvalidIndex(s) => write!(f, "Invalid slot: {}", s),
Self::Bug(s) => write!(f, "BUG: Please report this bug: {}", s),
}
}
}
impl Error for SlabbableError {}