2018-04-05 19:18:38 +00:00
|
|
|
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-04-05 19:18:38 +00:00
|
|
|
|
|
2018-10-06 16:18:06 +00:00
|
|
|
21 | / match x {
|
|
|
|
22 | | Some(y) => { println!("{:?}", y); }
|
|
|
|
23 | | _ => ()
|
|
|
|
24 | | };
|
2018-04-05 19:18:38 +00:00
|
|
|
| |_____^ help: try this: `if let Some(y) = x { println!("{:?}", y); }`
|
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
= note: `-D clippy::single-match` implied by `-D warnings`
|
2018-04-05 19:18:38 +00:00
|
|
|
|
|
|
|
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-04-05 19:18:38 +00:00
|
|
|
|
|
2018-10-27 12:45:02 +00:00
|
|
|
27 | / match x {
|
|
|
|
28 | | // Note the missing block braces.
|
|
|
|
29 | | // We suggest `if let Some(y) = x { .. }` because the macro
|
|
|
|
30 | | // is expanded before we can do anything.
|
|
|
|
31 | | Some(y) => println!("{:?}", y),
|
|
|
|
32 | | _ => ()
|
|
|
|
33 | | }
|
|
|
|
| |_____^ help: try this: `if let Some(y) = x { println!("{:?}", y) }`
|
|
|
|
|
|
|
|
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
|
|
|
|
--> $DIR/single_match.rs:36:5
|
|
|
|
|
|
|
|
|
36 | / match z {
|
|
|
|
37 | | (2...3, 7...9) => dummy(),
|
|
|
|
38 | | _ => {}
|
|
|
|
39 | | };
|
2018-04-05 19:18:38 +00:00
|
|
|
| |_____^ 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-27 12:45:02 +00:00
|
|
|
--> $DIR/single_match.rs:62:5
|
2018-04-05 19:18:38 +00:00
|
|
|
|
|
2018-10-27 12:45:02 +00:00
|
|
|
62 | / match x {
|
|
|
|
63 | | Some(y) => dummy(),
|
|
|
|
64 | | None => ()
|
|
|
|
65 | | };
|
2018-04-05 19:18:38 +00:00
|
|
|
| |_____^ 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-27 12:45:02 +00:00
|
|
|
--> $DIR/single_match.rs:67:5
|
2018-04-05 19:18:38 +00:00
|
|
|
|
|
2018-10-27 12:45:02 +00:00
|
|
|
67 | / match y {
|
|
|
|
68 | | Ok(y) => dummy(),
|
|
|
|
69 | | Err(..) => ()
|
|
|
|
70 | | };
|
2018-04-05 19:18:38 +00:00
|
|
|
| |_____^ 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-27 12:45:02 +00:00
|
|
|
--> $DIR/single_match.rs:74:5
|
2018-04-05 19:18:38 +00:00
|
|
|
|
|
2018-10-27 12:45:02 +00:00
|
|
|
74 | / match c {
|
|
|
|
75 | | Cow::Borrowed(..) => dummy(),
|
|
|
|
76 | | Cow::Owned(..) => (),
|
|
|
|
77 | | };
|
2018-04-05 19:18:38 +00:00
|
|
|
| |_____^ help: try this: `if let Cow::Borrowed(..) = c { dummy() }`
|
|
|
|
|
2018-10-27 12:45:02 +00:00
|
|
|
error: aborting due to 6 previous errors
|
2018-04-05 19:18:38 +00:00
|
|
|
|