#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Scoring {
Detected,
Undetected,
Excluded,
}
impl Scoring {
#[must_use]
pub const fn is_valid(self) -> bool {
!matches!(self, Self::Excluded)
}
#[must_use]
pub const fn is_detected(self) -> bool {
matches!(self, Self::Detected)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn everything_detected_is_also_counted() {
for scoring in [Scoring::Detected, Scoring::Undetected, Scoring::Excluded] {
assert!(!scoring.is_detected() || scoring.is_valid(), "{scoring:?}");
}
}
}