1
Fork 0

Use HashMap entry APIs more

This commit is contained in:
Nilstrieb 2023-04-09 21:53:03 +02:00
parent f058d05fc2
commit 54e1309c65
2 changed files with 9 additions and 8 deletions

View file

@ -266,12 +266,12 @@ impl LintLevelsProvider for QueryMapExpectationsWrapper<'_> {
let LintExpectationId::Stable { attr_id: Some(attr_id), hir_id, attr_index, .. } = id else { bug!("unstable expectation id should already be mapped") };
let key = LintExpectationId::Unstable { attr_id, lint_index: None };
if !self.unstable_to_stable_ids.contains_key(&key) {
self.unstable_to_stable_ids.insert(
key,
LintExpectationId::Stable { hir_id, attr_index, lint_index: None, attr_id: None },
);
}
self.unstable_to_stable_ids.entry(key).or_insert(LintExpectationId::Stable {
hir_id,
attr_index,
lint_index: None,
attr_id: None,
});
self.expectations.push((id.normalize(), expectation));
}