1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#[derive(PartialEq, Eq, Debug, Copy, Clone)] /// The strictness to operate in, this defines at which ErrorLevel the program should stop execution upon finding an error. pub enum StrictnessLevel { /// With `Strict` the program will always stop execution upon finding an error. Strict, /// With `Medium` the program will allow `ErrorLevel::GeneralWarning`. Medium, /// With `Loose` the program will allow `ErrorLevel::GeneralWarning` and `ErrorLevel::LooseWarning`. Loose, } impl std::fmt::Display for StrictnessLevel { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { write!( f, "{}", match self { StrictnessLevel::Strict => "Strict", StrictnessLevel::Medium => "Medium", StrictnessLevel::Loose => "Loose", } ) } }