]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/source/file-lines-1.rs
Add 'src/tools/rustfmt/' from commit '7872306edf2e11a69aaffb9434088fd66b46a863'
[rust.git] / src / tools / rustfmt / tests / source / file-lines-1.rs
1 // rustfmt-file_lines: [{"file":"tests/source/file-lines-1.rs","range":[4,8]}]
2
3 fn floaters() {
4     let x = Foo {
5                 field1: val1,
6                 field2: val2,
7             }
8             .method_call().method_call();
9
10     let y = if cond {
11                 val1
12             } else {
13                 val2
14             }
15                 .method_call();
16
17     {
18         match x {
19             PushParam => {
20                 // comment
21                 stack.push(mparams[match cur.to_digit(10) {
22                                             Some(d) => d as usize - 1,
23                                             None => return Err("bad param number".to_owned()),
24                                         }]
25                                .clone());
26             }
27         }
28     }
29 }