]> git.lizzy.rs Git - rust.git/blob - tests/source/expr-overflow-delimited.rs
chore: bump toolchain
[rust.git] / tests / source / expr-overflow-delimited.rs
1 // rustfmt-overflow_delimited_expr: true
2
3 fn combine_blocklike() {
4     do_thing(
5         |param| {
6             action();
7             foo(param)
8         },
9     );
10
11     do_thing(
12         x,
13         |param| {
14             action();
15             foo(param)
16         },
17     );
18
19     do_thing(
20         x,
21
22         // I'll be discussing the `action` with your para(m)legal counsel
23         |param| {
24             action();
25             foo(param)
26         },
27     );
28
29     do_thing(
30         Bar {
31             x: value,
32             y: value2,
33         },
34     );
35
36     do_thing(
37         x,
38         Bar {
39             x: value,
40             y: value2,
41         },
42     );
43
44     do_thing(
45         x,
46
47         // Let me tell you about that one time at the `Bar`
48         Bar {
49             x: value,
50             y: value2,
51         },
52     );
53
54     do_thing(
55         &[
56             value_with_longer_name,
57             value2_with_longer_name,
58             value3_with_longer_name,
59             value4_with_longer_name,
60         ],
61     );
62
63     do_thing(
64         x,
65         &[
66             value_with_longer_name,
67             value2_with_longer_name,
68             value3_with_longer_name,
69             value4_with_longer_name,
70         ],
71     );
72
73     do_thing(
74         x,
75
76         // Just admit it; my list is longer than can be folded on to one line
77         &[
78             value_with_longer_name,
79             value2_with_longer_name,
80             value3_with_longer_name,
81             value4_with_longer_name,
82         ],
83     );
84
85     do_thing(
86         vec![
87             value_with_longer_name,
88             value2_with_longer_name,
89             value3_with_longer_name,
90             value4_with_longer_name,
91         ],
92     );
93
94     do_thing(
95         x,
96         vec![
97             value_with_longer_name,
98             value2_with_longer_name,
99             value3_with_longer_name,
100             value4_with_longer_name,
101         ],
102     );
103
104     do_thing(
105         x,
106
107         // Just admit it; my list is longer than can be folded on to one line
108         vec![
109             value_with_longer_name,
110             value2_with_longer_name,
111             value3_with_longer_name,
112             value4_with_longer_name,
113         ],
114     );
115
116     do_thing(
117         x,
118         (
119             1,
120             2,
121             3,
122             |param| {
123                 action();
124                 foo(param)
125             },
126         ),
127     );
128 }
129
130 fn combine_struct_sample() {
131     let identity = verify(
132         &ctx,
133         VerifyLogin {
134             type_: LoginType::Username,
135             username: args.username.clone(),
136             password: Some(args.password.clone()),
137             domain: None,
138         },
139     )?;
140 }
141
142 fn combine_macro_sample() {
143     rocket::ignite()
144         .mount(
145             "/",
146             routes![
147                 http::auth::login,
148                 http::auth::logout,
149                 http::cors::options,
150                 http::action::dance,
151                 http::action::sleep,
152             ],
153         )
154         .launch();
155 }