]> git.lizzy.rs Git - rust.git/blob - tests/target/struct_lits_visual_multiline.rs
struct_lit_multiline_style -> struct_lit_single_line (and make it a bool)
[rust.git] / tests / target / struct_lits_visual_multiline.rs
1 // rustfmt-normalize_comments: true
2 // rustfmt-wrap_comments: true
3 // rustfmt-indent_style: Visual
4 // rustfmt-struct_lit_single_line: false
5 // rustfmt-error_on_line_overflow: false
6
7 // Struct literal expressions.
8
9 fn main() {
10     let x = Bar;
11
12     // Comment
13     let y = Foo { a: x };
14
15     Foo { a: foo(), // comment
16           // comment
17           b: bar(),
18           ..something };
19
20     Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: foo(),
21                                                                                b: bar(), };
22
23     Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { // Comment
24                                                                                         a: foo(), /* Comment */
25                                                                                         // Comment
26                                                                                         b: bar(), /* Comment */ };
27
28     Foo { a: Bar,
29           b: foo(), };
30
31     Quux { x: if cond {
32                bar();
33            },
34            y: baz(), };
35
36     A { // Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit
37         // amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante
38         // hendrerit. Donec et mollis dolor.
39         first: item(),
40         // Praesent et diam eget libero egestas mattis sit amet vitae augue.
41         // Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
42         second: Item, };
43
44     Diagram { //                 o        This graph demonstrates how
45               //                / \       significant whitespace is
46               //               o   o      preserved.
47               //              /|\   \
48               //             o o o   o
49               graph: G, }
50 }