use core::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[non_exhaustive]
pub enum Error {
NotFound,
BadData(&'static str),
BadZip(&'static str),
BadPosixTz(&'static str),
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::NotFound => f.write_str("timezone not found in embedded data"),
Error::BadData(why) => write!(f, "malformed timezone data: {why}"),
Error::BadZip(why) => write!(f, "malformed zip archive: {why}"),
Error::BadPosixTz(why) => write!(f, "malformed POSIX TZ string: {why}"),
}
}
}
impl core::error::Error for Error {}