leap/
error.rs

1use std::fmt;
2
3#[derive(Debug, PartialEq)]
4pub enum Error {
5    Date { year: u16, month: u8, day: u8 },
6}
7
8impl fmt::Display for Error {
9    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10        match self {
11            Error::Date { .. } => write!(f, "bad date: {self:?}"),
12        }
13    }
14}