Skip to content

Commit 0433e45

Browse files
jonbohy21
andauthored
use first instead of get(0)
Co-authored-by: Timo <[email protected]>
1 parent b3e262a commit 0433e45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/enum_variants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fn check_variant(cx: &LateContext<'_>, threshold: u64, def: &EnumDef<'_>, item_n
167167
return;
168168
}
169169

170-
let first = match &def.variants.get(0) {
170+
let first = match def.variants.first() {
171171
Some(variant) => variant.ident.name.as_str(),
172172
None => return,
173173
};

0 commit comments

Comments
 (0)