summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/configs/match_arm_leading_pipes/preserve.rs
blob: 4775575842ab99dd1b85248709808ee2d5256d5f (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
29
30
31
32
33
34
35
// rustfmt-match_arm_leading_pipes: Preserve

fn foo() {
    match foo {
        | "foo" | "bar" => {}
        | "baz"
        | "something relatively long"
        | "something really really really realllllllllllllly long" => println!("x"),
        | "qux" => println!("y"),
        _ => {}
    }
}

fn issue_3973() {
    match foo {
        | "foo" | "bar" => {}
        _ => {}
    }
}

fn bar() {
    match baz {
        "qux" => {}
        "foo" | "bar" => {}
        _ => {}
    }
}

fn f(x: NonAscii) -> bool {
    match x {
        // foo
        | Éfgh => true,
        _ => false,
    }
}