Replace list indexing for .get (fail-safe)

This commit is contained in:
blyxyas 2023-03-11 13:11:27 +01:00
parent 1cf72183cf
commit 2d572d4a9c
No known key found for this signature in database
GPG Key ID: 4D38170B5A2FC334

View File

@ -55,7 +55,8 @@ impl LateLintPass<'_> for AllowAttribute {
.name == sym!(feature);
if let ast::AttrKind::Normal(normal) = &attr.kind;
if let Some(MetaItemKind::List(list)) = normal.item.meta_kind();
if list[0].ident().unwrap().name == sym!(lint_reasons);
if let Some(symbol) = list.get(0);
if symbol.ident().unwrap().name == sym!(lint_reasons);
then {
self.lint_reasons_active = true;
}