We can include an if statement within a match pattern, as follows:
fn testcode(t: u8) { match t { 1 | 2 if t != 1 => println!("t was not one"), 1 | 2 if t != 2 => println!("t was not two"), _ => println!("") } }
We can include an if statement within a match pattern, as follows:
fn testcode(t: u8) { match t { 1 | 2 if t != 1 => println!("t was not one"), 1 | 2 if t != 2 => println!("t was not two"), _ => println!("") } }