wildcard-glob 11.2.0

Zero-dependency, zero-allocation compiled wildcard and path glob pattern matcher supporting *, **, ?, character classes, brace alternation, and multi-pattern GlobSet.
Documentation
use super::*;

/// Formats [`GlobError`] into a human-readable message.
impl fmt::Display for GlobError {
    /// Writes the diagnostic text for this error.
    ///
    /// # 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::UnclosedClass => ERR_UNCLOSED_CLASS,
            Self::UnclosedBrace => ERR_UNCLOSED_BRACE,
            Self::UnmatchedCloseBrace => ERR_UNMATCHED_CLOSE_BRACE,
            Self::TrailingEscape => ERR_TRAILING_ESCAPE,
            Self::InvalidRange => ERR_INVALID_RANGE,
            Self::ExpansionLimitExceeded => ERR_EXPANSION_LIMIT,
        };
        f.write_str(msg)
    }
}

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