Address nit

This commit is contained in:
Michael Goulet 2022-08-12 15:35:27 +00:00
parent 237cbe91a8
commit c6089189b3

View File

@ -1890,14 +1890,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
.flat_map(|id| self.tcx.hir().body(id).params) .flat_map(|id| self.tcx.hir().body(id).params)
.skip(if is_method { 1 } else { 0 }); .skip(if is_method { 1 } else { 0 });
for (idx, param) in params.into_iter().enumerate() { for (_, param) in params
if let Some(expected_idx) = expected_idx { .into_iter()
if idx == expected_idx { .enumerate()
spans.push_span_label(param.span, ""); .filter(|(idx, _)| expected_idx.map_or(true, |expected_idx| expected_idx == *idx))
} {
} else { spans.push_span_label(param.span, "");
spans.push_span_label(param.span, "");
}
} }
let def_kind = self.tcx.def_kind(def_id); let def_kind = self.tcx.def_kind(def_id);