External Publication
Visit Post

Q: Why do match expression need parenthesis for ops to the right but not left?

Rust Internals [Unofficial] April 8, 2026
Source

Note that assignment expressions result in (), so you can do that like:

let foo;
match bar {
    Some(_) => foo = 1,
    None => foo = 0,
}
// foo is now initialized

Discussion in the ATmosphere

Loading comments...