mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
49 lines
1.6 KiB
Text
49 lines
1.6 KiB
Text
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
|
|
--> $DIR/single_match.rs:21:5
|
|
|
|
|
21 | / match x {
|
|
22 | | Some(y) => { println!("{:?}", y); }
|
|
23 | | _ => ()
|
|
24 | | };
|
|
| |_____^ help: try this: `if let Some(y) = x { println!("{:?}", y); }`
|
|
|
|
|
= note: `-D clippy::single-match` implied by `-D warnings`
|
|
|
|
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
|
|
--> $DIR/single_match.rs:27:5
|
|
|
|
|
27 | / match z {
|
|
28 | | (2...3, 7...9) => dummy(),
|
|
29 | | _ => {}
|
|
30 | | };
|
|
| |_____^ help: try this: `if let (2...3, 7...9) = z { dummy() }`
|
|
|
|
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
|
|
--> $DIR/single_match.rs:53:5
|
|
|
|
|
53 | / match x {
|
|
54 | | Some(y) => dummy(),
|
|
55 | | None => ()
|
|
56 | | };
|
|
| |_____^ help: try this: `if let Some(y) = x { dummy() }`
|
|
|
|
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
|
|
--> $DIR/single_match.rs:58:5
|
|
|
|
|
58 | / match y {
|
|
59 | | Ok(y) => dummy(),
|
|
60 | | Err(..) => ()
|
|
61 | | };
|
|
| |_____^ help: try this: `if let Ok(y) = y { dummy() }`
|
|
|
|
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
|
|
--> $DIR/single_match.rs:65:5
|
|
|
|
|
65 | / match c {
|
|
66 | | Cow::Borrowed(..) => dummy(),
|
|
67 | | Cow::Owned(..) => (),
|
|
68 | | };
|
|
| |_____^ help: try this: `if let Cow::Borrowed(..) = c { dummy() }`
|
|
|
|
error: aborting due to 5 previous errors
|
|
|