1 #![warn(clippy::single_match)]
17 // Note the missing block braces.
18 // We suggest `if let Some(y) = x { .. }` because the macro
19 // is expanded before we can do anything.
20 Some(y) => println!("{:?}", y),
26 (2..=3, 7..=9) => dummy(),
30 // Not linted (pattern guards used)
32 Some(y) if y == 0 => println!("{:?}", y),
36 // Not linted (no block with statements in the single arm)
38 (2..=3, 7..=9) => println!("{:?}", z),
39 _ => println!("nope"),
50 fn single_match_know_enum() {
52 let y: Result<_, i8> = Ok(1i8);
64 let c = Cow::Borrowed("");
67 Cow::Borrowed(..) => dummy(),
74 Bar => println!("42"),
79 Baz(_) => println!("42"),
84 macro_rules! single_match {