-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop linting else if let
pattern in [option_if_let_else
] lint
#7216
Conversation
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
if arms.len() == 2; | ||
if !is_result_ok(cx, cond_expr); // Don't lint on Result::ok because a different lint does it already | ||
if let PatKind::TupleStruct(struct_qpath, &[inner_pat], _) = &arms[0].pat.kind; | ||
if is_lang_ctor(cx, struct_qpath, OptionSome); | ||
if let PatKind::Binding(bind_annotation, _, id, _) = &inner_pat.kind; | ||
if !contains_return_break_continue_macro(arms[0].body); | ||
if !contains_return_break_continue_macro(arms[1].body); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's that empty line for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! that's en habit for readability, I should have discard it before pushing, sorry
Regardless of the empty line, this is a good improvement. And I don't think an empty line should matter that much. So @bors r+ from my side. |
📌 Commit 368e621 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Remove dead code after #7216 changelog: none
Remove dead code after #7216 changelog: none
For readability concerns, it is counterproductive to lint
else if let
pattern.Unfortunately the suggested code is much less readable.
Fixes: #7006
changelog: stop linting
else if let
pattern in [option_if_let_else
] lint