mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 04:55:22 +03:00
use first instead of get(0)
Co-authored-by: Timo <30553356+y21@users.noreply.github.com>
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user