-
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
redundant_pattern_matching #10753
redundant_pattern_matching #10753
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @dswij (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
@xFrednet can you help me please ? |
Sure, I'm guessing, your question is how to prevent the other lint from triggering in this case? In the test files, you could just use Does this explanation make sense? :) |
Thank you so much I will try this :-) |
@xFrednet Can you check my changes if you have some time please :) |
Sure, I'll take a look at it later today or tomorrow. :) r? @xFrednet |
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.
This already looks good overall, I have a few NITs, where I would appreciate it if you could update them. But then it'll be ready to be merged :)
Thanks @xFrednet :) |
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.
Thank you for the swift update. I still have a NIT when it comes to the tests, but that should be a simple update. Once that is done, we can merge it. Could you also squash your fix commits, to only have one or two?
PS, I'll be gone over the weekend, so the next review will be done some time next week :)
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.
The Option
tests still need some adjustments. Then it should be ready.
Have you seen my request to squash your commits, from the last review?
Could you also squash your fix commits, to only have one or two?
I hope I made the right changes this time ;) |
This version looks good to me, thank you for the PR. I hope you had fun working on Clippy :) @bors r+ |
redundant_pattern_matching This PR try to solve this issue #10726, but it enter in conflict with another test. Try to test this: ``` let _w = match x { Some(_) => true, _ => false, }; ``` this happen: ``` error: match expression looks like `matches!` macro --> $DIR/match_expr_like_matches_macro.rs:21:14 | LL | let _w = match x { | ______________^ LL | | Some(_) => true, LL | | _ => false, LL | | }; | |_____^ help: try this: `matches!(x, Some(_))` +error: redundant pattern matching, consider using `is_some()` + --> $DIR/match_expr_like_matches_macro.rs:21:14 + | +LL | let _w = match x { + | ______________^ +LL | | Some(_) => true, +LL | | _ => false, +LL | | }; + | |_____^ help: try this: `x.is_some()` + | + = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings` + ``` I need some help to fix this. Thanks
💔 Test failed - checks-action_test |
@disco07: 🔑 Insufficient privileges: not in try users |
@xFrednet I update my PR to add changelog: none |
No problem :) @bors retry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This PR try to solve this issue #10726,
but it enter in conflict with another test.
changelog: none
Try to test this:
this happen:
I need some help to fix this. Thanks