about summary refs log tree commit diff
path: root/src/tools/rustfmt/tests/target/postfix-match/pf-match.rs
blob: f439f2726235eb57bfd656212c1155bde2a8bb8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![feature(postfix_match)]

fn main() {
    let val = Some(42);

    val.match {
        Some(_) => 2,
        _ => 1,
    };

    Some(2).match {
        Some(_) => true,
        None => false,
    }.match {
        false => "ferris is cute",
        true => "I turn cats in to petted cats",
    }.match {
        _ => (),
    }
}