mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
c8ff8a4dc7
Signed-off-by: Sasha Pourcelot <sasha.pourcelot@protonmail.com>
22 lines
331 B
Rust
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 {
|
|
_ => (),
|
|
}
|
|
}
|