#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
#[error("'{value}' is not one of: {expected}")]
pub struct UnknownValue {
pub value: String,
pub expected: String,
}
impl UnknownValue {
pub(crate) fn new(value: &str, expected: impl Iterator<Item = &'static str>) -> Self {
Self {
value: value.to_string(),
expected: expected.collect::<Vec<_>>().join(", "),
}
}
}