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