Skip to content

Commit c608918

Browse files
Address nit
1 parent 237cbe9 commit c608918

File tree

1 file changed

+6
-8
lines changed
  • compiler/rustc_typeck/src/check/fn_ctxt

1 file changed

+6
-8
lines changed

compiler/rustc_typeck/src/check/fn_ctxt/checks.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -1890,14 +1890,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
18901890
.flat_map(|id| self.tcx.hir().body(id).params)
18911891
.skip(if is_method { 1 } else { 0 });
18921892

1893-
for (idx, param) in params.into_iter().enumerate() {
1894-
if let Some(expected_idx) = expected_idx {
1895-
if idx == expected_idx {
1896-
spans.push_span_label(param.span, "");
1897-
}
1898-
} else {
1899-
spans.push_span_label(param.span, "");
1900-
}
1893+
for (_, param) in params
1894+
.into_iter()
1895+
.enumerate()
1896+
.filter(|(idx, _)| expected_idx.map_or(true, |expected_idx| expected_idx == *idx))
1897+
{
1898+
spans.push_span_label(param.span, "");
19011899
}
19021900

19031901
let def_kind = self.tcx.def_kind(def_id);

0 commit comments

Comments
 (0)