use std::fmt::{Display, Formatter};
use super::Metric;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SettingsError {
MetricNotSet,
UnsupportedMetric(Metric),
}
impl Display for SettingsError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Self::MetricNotSet => write!(f, "a metric must be set"),
Self::UnsupportedMetric(m) => write!(f, "unsupported metric: {m}"),
}
}
}
impl std::error::Error for SettingsError {}