Skip to content

Commit 2d572d4

Browse files
committed
Replace list indexing for .get (fail-safe)
1 parent 1cf7218 commit 2d572d4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clippy_lints/src/allow_attribute.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ impl LateLintPass<'_> for AllowAttribute {
5555
.name == sym!(feature);
5656
if let ast::AttrKind::Normal(normal) = &attr.kind;
5757
if let Some(MetaItemKind::List(list)) = normal.item.meta_kind();
58-
if list[0].ident().unwrap().name == sym!(lint_reasons);
58+
if let Some(symbol) = list.get(0);
59+
if symbol.ident().unwrap().name == sym!(lint_reasons);
5960
then {
6061
self.lint_reasons_active = true;
6162
}

0 commit comments

Comments
 (0)