mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Simplify code
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
This commit is contained in:
@@ -1049,8 +1049,7 @@ fn e0023(
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user