use first instead of get(0)

Co-authored-by: Timo <30553356+y21@users.noreply.github.com>
This commit is contained in:
Jon 2023-09-24 21:37:56 +02:00 committed by GitHub
parent b3e262acfd
commit 0433e458da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
};