summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/width-heuristics.rs
blob: a591218b4ccc751663a93059fdc7ccc354c12596 (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
25
26
27
28
// 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;
        }
    }
}