use core::fmt;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct MissingFieldError {
field: &'static str,
}
impl MissingFieldError {
#[must_use]
pub const fn new(field: &'static str) -> Self {
Self { field }
}
#[must_use]
pub const fn field(&self) -> &'static str {
self.field
}
}
impl fmt::Display for MissingFieldError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "missing field `{}`", self.field)
}
}