Skip to content

Commit 5fe61a7

Browse files
camelidestebank
andcommitted
Simplify code
Co-authored-by: Esteban Kuber <[email protected]>
1 parent 16692ab commit 5fe61a7

File tree

1 file changed

+1
-2
lines changed
  • compiler/rustc_typeck/src/check

1 file changed

+1
-2
lines changed

compiler/rustc_typeck/src/check/pat.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,8 +1049,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10491049
pat_span.with_hi(pat_span.hi() - BytePos(1)).shrink_to_hi()
10501050
};
10511051

1052-
let mut wildcard_sugg =
1053-
iter::repeat("_").take(fields.len() - subpats.len()).collect::<Vec<_>>().join(", ");
1052+
let mut wildcard_sugg = vec!["_"; fields.len() - subpats.len()].join(", ");
10541053
if !subpats.is_empty() {
10551054
wildcard_sugg = String::from(", ") + &wildcard_sugg;
10561055
}

0 commit comments

Comments
 (0)