use core::fmt;
#[non_exhaustive]
#[derive(Debug)]
pub enum ArrayStringError {
    NotEnoughCapacity(usize),
    NotEnoughElements(usize),
}
impl fmt::Display for ArrayStringError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        use ArrayStringError as SE;
        match self {
            SE::NotEnoughCapacity(c) => write!(f, "Not enough capacity. Needed: {c}"),
            SE::NotEnoughElements(e) => write!(f, "Not enough elements. Needed: {e}"),
        }
    }
}
#[cfg(feature = "std")]
impl std::error::Error for ArrayStringError {}
pub(super) type Result<T> = core::result::Result<T, ArrayStringError>;