mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
use first instead of get(0)
Co-authored-by: Timo <30553356+y21@users.noreply.github.com>
This commit is contained in:
parent
b3e262acfd
commit
0433e458da
1 changed files with 1 additions and 1 deletions
|
@ -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,
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue