summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/width-heuristics.rs
blob: e177a2152e815dd98f409d9fcd7dfbe50e813052 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// rustfmt-max_width: 120

// elems on multiple lines for max_width 100, but same line for max_width 120
fn foo(e: Enum) {
    match e {
        Enum::Var { elem1, elem2, elem3 } => {
            return;
        }
    }
}

// elems not on same line for either max_width 100 or 120
fn bar(e: Enum) {
    match e {
        Enum::Var {
            elem1,
            elem2,
            elem3,
            elem4,
        } => {
            return;
        }
    }
}