solve-score 0.1.0

Independent implementation of SOLVE v0.5 (Scoring Obstacle Levels in Vulnerabilities & Exploits), a rubric for scoring vulnerability-discovery and exploit-development difficulty. Reproduces the 16 published calibration assessments. Not affiliated with or endorsed by Irregular.
Documentation
//! Error type for SOLVE score construction.

use core::fmt;

/// Failure to construct a value that the SOLVE specification bounds.
#[derive(Debug, Clone, Copy, PartialEq)]
#[non_exhaustive]
pub enum SolveError {
    /// A score fell outside the specification's `0.0..=10.0` range.
    OutOfRange {
        /// The rejected value.
        value: f64,
    },
    /// A score was NaN or infinite.
    NotFinite {
        /// The rejected value.
        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 {}