-
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
fix redundant_pattern_matching lint #5483
fix redundant_pattern_matching lint #5483
Conversation
And I have a couple questions. (so PR is WIP for now)
Thanks. |
|
diag.span_suggestion( | ||
span, | ||
"try this", | ||
format!("{}.{}{}", snippet(cx, op.span, "_"), good_method, maybe_semi), | ||
format!("{} {}.{}", keyword, snippet(cx, op.span, "_"), good_method), | ||
Applicability::MaybeIncorrect, // snippet |
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.
I think this is
Applicability::MaybeIncorrect, // snippet | |
Applicability::MachineApplicable, // snippet |
now
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.
Agree. Fixed.
|
|
- now it handles `while let` case - better suggestions in `if let` case
e21b881
to
092c459
Compare
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.
Thanks!
@bors r+ |
📌 Commit 092c459 has been approved by |
…1995 fix redundant_pattern_matching lint - now it handles `while let` case (related to #5462) - better suggestions in `if let` case
💔 Test failed - checks-action_test |
Don't worry about the changelog, this only means, that the PR body must contain a line @bors retry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
while let
case (related to SuggestOption::is_some
forwhile let Some(_) = iterator.next()
#5462)if let
casechangelog: Fix suggestion in
redundant_pattern_matching
and also apply this lint to thewhile let
case