From 0433e458dadc927e645f6307c0253a4b241dfd5b Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 24 Sep 2023 21:37:56 +0200 Subject: [PATCH] use first instead of get(0) Co-authored-by: Timo <30553356+y21@users.noreply.github.com> --- clippy_lints/src/enum_variants.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/enum_variants.rs b/clippy_lints/src/enum_variants.rs index 85334d09d4b4..e332f681b6db 100644 --- a/clippy_lints/src/enum_variants.rs +++ b/clippy_lints/src/enum_variants.rs @@ -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, };