rust-clippy/tests/ui/single_match.stderr

50 lines
1.6 KiB
Text
Raw Normal View History

error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
2018-10-06 16:18:06 +00:00
--> $DIR/single_match.rs:21:5
|
2018-10-06 16:18:06 +00:00
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`
2018-10-06 16:18:06 +00:00
--> $DIR/single_match.rs:27:5
|
2018-10-06 16:18:06 +00:00
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`
2018-10-06 16:18:06 +00:00
--> $DIR/single_match.rs:53:5
|
2018-10-06 16:18:06 +00:00
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`
2018-10-06 16:18:06 +00:00
--> $DIR/single_match.rs:58:5
|
2018-10-06 16:18:06 +00:00
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`
2018-10-06 16:18:06 +00:00
--> $DIR/single_match.rs:65:5
|
2018-10-06 16:18:06 +00:00
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