mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
3f72d4d630
There's only one test currently. I also updated the lint doc with a 'good' example and changed the lint help text a bit. cc #2038
13 lines
527 B
Text
13 lines
527 B
Text
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),
|
|
23 | | _ => { let x = 5; None },
|
|
24 | | }
|
|
| |_____^ help: try this: `if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { let x = 5; None }`
|
|
|
|
|
= note: `-D clippy::single-match-else` implied by `-D warnings`
|
|
|
|
error: aborting due to previous error
|
|
|