Is it possible to have instructions in the pattern matching branches?
I tried this, but it does not work. Maybe there is some special syntax to achieve this?
fn main() {
let x = 5i;
match x {
1 => println!("one"),
_ => println!("something"); // error: expected one of `,`, `}`, found `;`
println!("else"),
}
}
source
share