1use core::fmt;
4
5#[derive(Debug, Clone, Copy, PartialEq)]
7#[non_exhaustive]
8pub enum SolveError {
9 OutOfRange {
11 value: f64,
13 },
14 NotFinite {
16 value: f64,
18 },
19}
20
21impl fmt::Display for SolveError {
22 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
23 match self {
24 Self::OutOfRange { value } => {
25 write!(f, "score {value} is outside the SOLVE range 0.0..=10.0")
26 }
27 Self::NotFinite { value } => write!(f, "score {value} is not finite"),
28 }
29 }
30}
31
32impl core::error::Error for SolveError {}