2018-12-04 00:17:53 -06:00
|
|
|
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
|
2020-07-06 17:35:51 -05:00
|
|
|
--> $DIR/single_match_else.rs:14:5
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / match ExprNode::Butterflies {
|
|
|
|
LL | | ExprNode::ExprAddrOf => Some(&NODE),
|
|
|
|
LL | | _ => {
|
|
|
|
LL | | let x = 5;
|
|
|
|
LL | | None
|
|
|
|
LL | | },
|
|
|
|
LL | | }
|
2018-12-09 23:27:19 -06:00
|
|
|
| |_____^
|
2018-12-04 00:17:53 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::single-match-else` implied by `-D warnings`
|
2018-12-09 23:27:19 -06:00
|
|
|
help: try this
|
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else {
|
2020-02-04 09:13:06 -06:00
|
|
|
LL | let x = 5;
|
|
|
|
LL | None
|
|
|
|
LL | }
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2018-12-04 00:17:53 -06:00
|
|
|
|
2020-07-06 17:35:51 -05:00
|
|
|
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
|
|
|
|
--> $DIR/single_match_else.rs:70:5
|
|
|
|
|
|
|
|
|
LL | / match Some(1) {
|
|
|
|
LL | | Some(a) => println!("${:?}", a),
|
|
|
|
LL | | None => {
|
|
|
|
LL | | println!("else block");
|
|
|
|
LL | | return
|
|
|
|
LL | | },
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: try this
|
|
|
|
|
|
|
|
|
LL | if let Some(a) = Some(1) { println!("${:?}", a) } else {
|
|
|
|
LL | println!("else block");
|
|
|
|
LL | return
|
|
|
|
LL | }
|
|
|
|
|
|
|
|
|
|
|
|
|
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
|
|
|
|
--> $DIR/single_match_else.rs:79:5
|
|
|
|
|
|
|
|
|
LL | / match Some(1) {
|
|
|
|
LL | | Some(a) => println!("${:?}", a),
|
|
|
|
LL | | None => {
|
|
|
|
LL | | println!("else block");
|
|
|
|
LL | | return;
|
|
|
|
LL | | },
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: try this
|
|
|
|
|
|
|
|
|
LL | if let Some(a) = Some(1) { println!("${:?}", a) } else {
|
|
|
|
LL | println!("else block");
|
|
|
|
LL | return;
|
|
|
|
LL | }
|
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2018-12-04 00:17:53 -06:00
|
|
|
|