1 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
2 --> $DIR/single_match.rs:8:5
6 LL | | println!("{:?}", y);
12 = note: `-D clippy::single-match` implied by `-D warnings`
15 LL ~ if let Some(y) = x {
16 LL + println!("{:?}", y);
20 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
21 --> $DIR/single_match.rs:16:5
24 LL | | // Note the missing block braces.
25 LL | | // We suggest `if let Some(y) = x { .. }` because the macro
26 LL | | // is expanded before we can do anything.
27 LL | | Some(y) => println!("{:?}", y),
30 | |_____^ help: try this: `if let Some(y) = x { println!("{:?}", y) }`
32 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
33 --> $DIR/single_match.rs:25:5
36 LL | | (2..=3, 7..=9) => dummy(),
39 | |_____^ help: try this: `if let (2..=3, 7..=9) = z { dummy() }`
41 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
42 --> $DIR/single_match.rs:54:5
45 LL | | Some(y) => dummy(),
48 | |_____^ help: try this: `if let Some(y) = x { dummy() }`
50 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
51 --> $DIR/single_match.rs:59:5
54 LL | | Ok(y) => dummy(),
57 | |_____^ help: try this: `if let Ok(y) = y { dummy() }`
59 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
60 --> $DIR/single_match.rs:66:5
63 LL | | Cow::Borrowed(..) => dummy(),
64 LL | | Cow::Owned(..) => (),
66 | |_____^ help: try this: `if let Cow::Borrowed(..) = c { dummy() }`
68 error: you seem to be trying to use `match` for an equality check. Consider using `if`
69 --> $DIR/single_match.rs:87:5
72 LL | | "test" => println!(),
75 | |_____^ help: try this: `if x == "test" { println!() }`
77 error: you seem to be trying to use `match` for an equality check. Consider using `if`
78 --> $DIR/single_match.rs:100:5
81 LL | | Foo::A => println!(),
84 | |_____^ help: try this: `if x == Foo::A { println!() }`
86 error: you seem to be trying to use `match` for an equality check. Consider using `if`
87 --> $DIR/single_match.rs:106:5
90 LL | | FOO_C => println!(),
93 | |_____^ help: try this: `if x == FOO_C { println!() }`
95 error: you seem to be trying to use `match` for an equality check. Consider using `if`
96 --> $DIR/single_match.rs:111:5
99 LL | | Foo::A => println!(),
102 | |_____^ help: try this: `if x == Foo::A { println!() }`
104 error: you seem to be trying to use `match` for an equality check. Consider using `if`
105 --> $DIR/single_match.rs:117:5
108 LL | | Foo::A => println!(),
111 | |_____^ help: try this: `if x == &Foo::A { println!() }`
113 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
114 --> $DIR/single_match.rs:134:5
117 LL | | Bar::A => println!(),
120 | |_____^ help: try this: `if let Bar::A = x { println!() }`
122 error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
123 --> $DIR/single_match.rs:142:5
126 LL | | None => println!(),
129 | |_____^ help: try this: `if let None = x { println!() }`
131 error: aborting due to 13 previous errors