]> git.lizzy.rs Git - rust.git/blob - tests/target/else-if-brace-style-always-same-line.rs
Merge pull request #1017 from marcusklaas/tweak-if-else
[rust.git] / tests / target / else-if-brace-style-always-same-line.rs
1 // rustfmt-single_line_if_else_max_width: 0
2 // rustfmt-else_if_brace_style: AlwaysSameLine
3
4 fn main() {
5     if false {
6         ();
7         ();
8     }
9
10     if false
11     // lone if comment
12     {
13         ();
14         ();
15     }
16
17
18     let a = if 0 > 1 {
19         unreachable!()
20     } else {
21         0x0
22     };
23
24
25     if true {
26         ();
27     } else if false {
28         ();
29         ();
30     } else {
31         ();
32         ();
33         ();
34     }
35
36     if true
37     // else-if-chain if comment
38     {
39         ();
40     } else if false
41     // else-if-chain else-if comment
42     {
43         ();
44         ();
45     } else
46     // else-if-chain else comment
47     {
48         ();
49         ();
50         ();
51     }
52 }