use Iterator::zip instead of enumerating+indexing

This commit is contained in:
Yotam Ofek 2025-02-05 12:54:31 +00:00
parent ce36a966c7
commit a7a43cd373

View file

@ -1150,9 +1150,9 @@ fn clean_args_from_types_and_body_id<'tcx>(
Arguments {
values: types
.iter()
.enumerate()
.map(|(i, ty)| Argument {
name: name_from_pat(body.params[i].pat),
.zip(body.params)
.map(|(ty, param)| Argument {
name: name_from_pat(param.pat),
type_: clean_ty(ty, cx),
is_const: false,
})