]> git.lizzy.rs Git - rust.git/blob - tests/target/control-brace-style-always-same-line.rs
Add visual indent tests for chains
[rust.git] / tests / target / control-brace-style-always-same-line.rs
1 // rustfmt-control_brace_style: AlwaysSameLine
2
3 fn main() {
4     loop {
5         ();
6         ();
7     }
8
9
10     'loop_label: loop {
11         ();
12     }
13
14
15     cond = true;
16     while cond {
17         ();
18     }
19
20
21     'while_label: while cond {
22         // while comment
23         ();
24     }
25
26
27     for obj in iter {
28         for sub_obj in obj {
29             'nested_while_label: while cond {
30                 ();
31             }
32         }
33     }
34
35     match some_var { // match comment
36         pattern0 => val0,
37         pattern1 => val1,
38         pattern2 | pattern3 => {
39             do_stuff();
40             val2
41         }
42     };
43 }