use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ReductionError {
message: String,
}
impl ReductionError {
pub fn new(message: impl Into<String>) -> Self {
Self {
message: message.into(),
}
}
pub fn message(&self) -> &str {
&self.message
}
}
impl fmt::Display for ReductionError {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str(&self.message)
}
}
impl std::error::Error for ReductionError {}
pub type Result<T> = std::result::Result<T, ReductionError>;