Skip to content

Commit

Permalink
use first instead of get(0)
Browse files Browse the repository at this point in the history
Co-authored-by: Timo <[email protected]>
  • Loading branch information
jonboh and y21 authored Sep 24, 2023
1 parent b3e262a commit 0433e45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_lints/src/enum_variants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ fn check_variant(cx: &LateContext<'_>, threshold: u64, def: &EnumDef<'_>, item_n
return;
}

let first = match &def.variants.get(0) {
let first = match def.variants.first() {
Some(variant) => variant.ident.name.as_str(),
None => return,
};
Expand Down

0 comments on commit 0433e45

Please sign in to comment.