rust/tests/pretty/postfix-match/simple-matches.rs
Sasha Pourcelot c8ff8a4dc7 Pretty-print parenthesis around binary in postfix match
Signed-off-by: Sasha Pourcelot <sasha.pourcelot@protonmail.com>
2024-04-29 11:34:22 +02:00

22 lines
331 B
Rust

#![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 {
_ => (),
}
}