ingredients 0.1.0

Check ingredients of published Rust crates
Documentation
use std::fmt::Display;

/// Severity associated with report and diff items
#[derive(Debug)]
#[non_exhaustive]
// keep in sync with the Python enum
pub enum Severity {
    /// Fatal problems that prevent further processing
    Fatal,
    /// Probable errors that require manual investigation
    Error,
    /// Potential issues that might or might not be harmless
    Warning,
    /// Additional information provided for some situations
    Info,
}

impl Display for Severity {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Severity::Fatal => write!(f, "fatal"),
            Severity::Error => write!(f, "error"),
            Severity::Warning => write!(f, "warning"),
            Severity::Info => write!(f, "info"),
        }
    }
}