// auto-generated by: jiff-cli generate shared

pub(crate) mod itime;

/// An error scoped to Jiff's `shared` module.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Error {
    kind: ErrorKind,
}

impl core::fmt::Display for Error {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        self.kind.fmt(f)
    }
}

#[derive(Clone, Debug, Eq, PartialEq)]
enum ErrorKind {
    Time(self::itime::Error),
}

impl From<ErrorKind> for Error {
    fn from(kind: ErrorKind) -> Error {
        Error { kind }
    }
}

impl core::fmt::Display for ErrorKind {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        match *self {
            ErrorKind::Time(ref err) => err.fmt(f),
        }
    }
}

/*
/// A slim error that occurs when an input value is out of bounds.
#[derive(Clone, Debug)]
struct SlimRangeError {
    what: &'static str,
}

impl SlimRangeError {
    fn new(what: &'static str) -> SlimRangeError {
        SlimRangeError { what }
    }
}

impl std::error::Error for SlimRangeError {}

impl core::fmt::Display for SlimRangeError {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        let SlimRangeError { what } = *self;
        write!(f, "parameter '{what}' is not in the required range")
    }
}
*/
