]> git.lizzy.rs Git - rust.git/blob - tests/target/chains-block-indented-base.rs
Handle attributes on modules (#968)
[rust.git] / tests / target / chains-block-indented-base.rs
1 // rustfmt-chain_base_indent: Inherit
2 // Test chain formatting with block indented base
3
4 fn floaters() {
5     let x = Foo {
6         field1: val1,
7         field2: val2,
8     }
9     .method_call()
10     .method_call();
11
12     let y = if cond {
13         val1
14     } else {
15         val2
16     }
17     .method_call();
18
19     {
20         match x {
21             PushParam => {
22                 // params are 1-indexed
23                 stack.push(mparams[match cur.to_digit(10) {
24                     Some(d) => d as usize - 1,
25                     None => return Err("bad param number".to_owned()),
26                 }]
27                 .clone());
28             }
29         }
30     }
31 }