Use hir_def::builtin_attr::find_builtin_attr_idx

This commit is contained in:
Lukas Wirth 2023-04-06 19:44:06 +02:00
parent 99b69525f4
commit 40c068f502
2 changed files with 4 additions and 9 deletions

View file

@ -2697,9 +2697,7 @@ impl BuiltinAttr {
}
fn builtin(name: &str) -> Option<Self> {
hir_def::builtin_attr::INERT_ATTRIBUTES
.iter()
.position(|tool| tool.name == name)
hir_def::builtin_attr::find_builtin_attr_idx(name)
.map(|idx| BuiltinAttr { krate: None, idx: idx as u32 })
}