utc-cron-expr 11.1.0

Zero-dependency 5-field and 6-field POSIX/Quartz cron expression parser, O(1) bitmask matcher, and fast civil-calendar next-occurrence calculator.
Documentation
use super::*;

/// Formats [`CronError`] as a human-readable diagnostic string.
impl fmt::Display for CronError {
    /// Writes the diagnostic text to `f`.
    ///
    /// # Arguments
    ///
    /// - `&mut fmt::Formatter<'_>` - Destination formatter.
    ///
    /// # Returns
    ///
    /// - `fmt::Result` - Formatting outcome.
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        let msg: &str = match self {
            Self::InvalidFieldCount => ERR_INVALID_FIELD_COUNT,
            Self::InvalidFieldSyntax => ERR_INVALID_FIELD_SYNTAX,
            Self::ValueOutOfRange => ERR_VALUE_OUT_OF_RANGE,
            Self::InvalidStep => ERR_INVALID_STEP,
        };
        f.write_str(msg)
    }
}

/// Marks [`CronError`] as a standard error type.
impl Error for CronError {}