1
Fork 0

Plumb through rustc_lint_defs::Level as enum rather than string.

This commit is contained in:
Jeremy Fitzhardinge 2022-04-15 01:24:49 -07:00 committed by Jeremy Fitzhardinge
parent 39f2f18463
commit 0529a13b5d
5 changed files with 19 additions and 9 deletions

View file

@ -214,6 +214,13 @@ impl Level {
_ => None,
}
}
pub fn is_error(self) -> bool {
match self {
Level::Allow | Level::Expect(_) | Level::Warn | Level::ForceWarn => false,
Level::Deny | Level::Forbid => true,
}
}
}
/// Specification of a single lint.