Open
Description
What it does
- Simplified code
Advantage
- Clean
Drawbacks
Possible change of Drop point
Example
fn main() {
let (a, b) = (2, 3);
match (a, b) {
(_, 2) => todo!(),
(_, 3) => todo!(),
_ => todo!(),
}
}
Could be written as:
fn main() {
let (a, b) = (2, 3);
match b {
2 => todo!(),
3 => todo!(),
_ => todo!(),
}
}