summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/configs/use_field_init_shorthand/true.rs
blob: dcde28d74e0f1d6186d6644ec022498b245dc682 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// rustfmt-use_field_init_shorthand: true
// Use field initialization shorthand if possible.

fn main() {
    let a = Foo {
        x: x,
        y: y,
        z: z,
    };

    let b = Bar {
        x: x,
        y: y,
        #[attr]
        z: z,
        #[rustfmt::skip]
        skipped: skipped,
    };
}