]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #59076 - dtolnay:comma, r=alexcrichton
authorbors <bors@rust-lang.org>
Fri, 5 Apr 2019 15:01:07 +0000 (15:01 +0000)
committerbors <bors@rust-lang.org>
Fri, 5 Apr 2019 15:01:07 +0000 (15:01 +0000)
Include trailing comma in multiline Debug representation

This PR changes the behavior of [`Formatter::debug_struct`](https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_struct), [`debug_tuple`](https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_tuple), [`debug_list`](https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_list), [`debug_set`](https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_set), and [`debug_map`](https://doc.rust-lang.org/std/fmt/struct.Formatter.html#method.debug_map) to render trailing commas in `{:#?}` mode, which is the dominant style in modern Rust code.

#### Before:

```console
Language {
    name: "Rust",
    trailing_commas: false
}
```

#### After:

```console
Language {
    name: "Rust",
    trailing_commas: true,
}
```


Trivial merge