diff options
| author | Camelid <camelidcamel@gmail.com> | 2020-12-18 17:09:53 -0800 |
|---|---|---|
| committer | Camelid <camelidcamel@gmail.com> | 2021-01-12 19:25:50 -0800 |
| commit | 5fe61a79cc5d26a0843b7169d1c95fbb3cbda0ba (patch) | |
| tree | dd718d0b784c87c96c33097d1c985148c9d60d43 | |
| parent | 16692ab66a6e2c62b416f606f144d60711c14414 (diff) | |
| download | rust-5fe61a79cc5d26a0843b7169d1c95fbb3cbda0ba.tar.gz rust-5fe61a79cc5d26a0843b7169d1c95fbb3cbda0ba.zip | |
Simplify code
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
| -rw-r--r-- | compiler/rustc_typeck/src/check/pat.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_typeck/src/check/pat.rs b/compiler/rustc_typeck/src/check/pat.rs index 942be1007f0..db2f4eca0c9 100644 --- a/compiler/rustc_typeck/src/check/pat.rs +++ b/compiler/rustc_typeck/src/check/pat.rs @@ -1049,8 +1049,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { pat_span.with_hi(pat_span.hi() - BytePos(1)).shrink_to_hi() }; - let mut wildcard_sugg = - iter::repeat("_").take(fields.len() - subpats.len()).collect::<Vec<_>>().join(", "); + let mut wildcard_sugg = vec!["_"; fields.len() - subpats.len()].join(", "); if !subpats.is_empty() { wildcard_sugg = String::from(", ") + &wildcard_sugg; } |
