Use the pipe operator | within a single match arm to handle multiple patterns with the same logic. This syntax allows you to group distinct values or patterns that should trigger the same code block without repeating the body.
fn main() {
let number = 7;
match number {
1 | 3 | 5 | 7 => println!("Odd number: {}", number),
2 | 4 | 6 | 8 => println!("Even number: {}", number),
_ => println!("Other number"),
}
}