Simplify code
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
This commit is contained in:
parent
16692ab66a
commit
5fe61a79cc
1 changed files with 1 additions and 2 deletions
|
@ -1049,8 +1049,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
pat_span.with_hi(pat_span.hi() - BytePos(1)).shrink_to_hi()
|
pat_span.with_hi(pat_span.hi() - BytePos(1)).shrink_to_hi()
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut wildcard_sugg =
|
let mut wildcard_sugg = vec!["_"; fields.len() - subpats.len()].join(", ");
|
||||||
iter::repeat("_").take(fields.len() - subpats.len()).collect::<Vec<_>>().join(", ");
|
|
||||||
if !subpats.is_empty() {
|
if !subpats.is_empty() {
|
||||||
wildcard_sugg = String::from(", ") + &wildcard_sugg;
|
wildcard_sugg = String::from(", ") + &wildcard_sugg;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue