1
Fork 0

Add function to manually fulfill lint expectations (RFC 2383)

This commit is contained in:
xFrednet 2022-06-16 13:20:57 +02:00
parent 6c6388cd6c
commit c8b4873cf9
No known key found for this signature in database
GPG key ID: F5C59D0E669E5302
2 changed files with 39 additions and 1 deletions

View file

@ -229,6 +229,13 @@ impl Level {
Level::Deny | Level::Forbid => true,
}
}
pub fn get_expectation_id(&self) -> Option<LintExpectationId> {
match self {
Level::Expect(id) | Level::ForceWarn(Some(id)) => Some(*id),
_ => None,
}
}
}
/// Specification of a single lint.