use core::fmt;
#[derive(Debug, Clone, Copy, PartialEq)]
#[non_exhaustive]
pub enum SolveError {
OutOfRange {
value: f64,
},
NotFinite {
value: f64,
},
}
impl fmt::Display for SolveError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::OutOfRange { value } => {
write!(f, "score {value} is outside the SOLVE range 0.0..=10.0")
}
Self::NotFinite { value } => write!(f, "score {value} is not finite"),
}
}
}
impl core::error::Error for SolveError {}