refactor: statically guarantee that current error codes are documented

This commit is contained in:
Ezra Shaw 2023-02-25 20:14:10 +13:00
parent 70fd012439
commit 90677edcba
No known key found for this signature in database
GPG key ID: 67ABF16FB0ECD870
8 changed files with 33 additions and 67 deletions

View file

@ -1477,9 +1477,7 @@ impl HandlerInner {
.emitted_diagnostic_codes
.iter()
.filter_map(|x| match &x {
DiagnosticId::Error(s)
if registry.try_find_description(s).map_or(false, |o| o.is_some()) =>
{
DiagnosticId::Error(s) if registry.try_find_description(s).is_ok() => {
Some(s.clone())
}
_ => None,