use std::{error, fmt, num::TryFromIntError};
use adic::AdicError;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AdicShapeError {
AdicError(AdicError),
PetGraph,
ImproperConfig(String),
InfiniteDigits,
StyleError(String),
TryFromIntError,
}
impl fmt::Display for AdicShapeError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{self:?}")
}
}
impl error::Error for AdicShapeError { }
impl From<AdicError> for AdicShapeError {
fn from(e: AdicError) -> Self {
AdicShapeError::AdicError(e)
}
}
impl From<TryFromIntError> for AdicShapeError {
fn from(_: TryFromIntError) -> Self {
AdicShapeError::TryFromIntError
}
}