rust/tests/target/issue-5066/with_trailing_comma_never.rs
Yacin Tmimi 57ac92bf16 Prevent duplicate comma when formatting struct pattern with ".."
Fixes 5066

When a struct pattern that contained a ".." was formatted, it was
assumed that a trailing comma should always be added if the struct
fields weren't formatted vertically.

Now, a trailing comma is only added if not already included in the
reformatted struct fields.
2021-12-14 13:28:25 -06:00

6 lines
75 B
Rust

// rustfmt-trailing_comma: Never
fn main() {
let Foo { a, .. } = b;
}