2018-12-04 07:17:53 +01:00
|
|
|
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`
|
|
|
|
--> $DIR/single_match_else.rs:21:5
|
|
|
|
|
|
|
|
|
21 | / match ExprNode::Butterflies {
|
|
|
|
22 | | ExprNode::ExprAddrOf => Some(&NODE),
|
2018-12-10 06:27:19 +01:00
|
|
|
23 | | _ => {
|
|
|
|
24 | | let x = 5;
|
|
|
|
25 | | None
|
|
|
|
26 | | },
|
|
|
|
27 | | }
|
|
|
|
| |_____^
|
2018-12-04 07:17:53 +01:00
|
|
|
|
|
|
|
|
= note: `-D clippy::single-match-else` implied by `-D warnings`
|
2018-12-10 06:27:19 +01:00
|
|
|
help: try this
|
|
|
|
|
|
|
|
|
21 | if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else {
|
|
|
|
22 | let x = 5;
|
|
|
|
23 | None
|
|
|
|
24 | }
|
|
|
|
|
|
2018-12-04 07:17:53 +01:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|