-
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
New lint: option_manual_map #6573
Conversation
r? @ebroto (rust-highfive has picked a reviewer for you, use r? to override) |
f727193
to
5bbfdad
Compare
☔ The latest upstream changes (presumably #6500) made this pull request unmergeable. Please resolve the merge conflicts. |
5bbfdad
to
434c5d5
Compare
r? @llogiq (I'm leaving the team, so I'm reassigning my PRs to other active members) |
☔ The latest upstream changes (presumably #6528) made this pull request unmergeable. Please resolve the merge conflicts. |
r=me after a rebase. |
The lint could also work on |
I think you should be able to rebase ignoring |
@Jarcho do you intend to resume work on this? Can we help you with something? |
69a2186
to
1c0ba16
Compare
Basically ended up rewriting this.
|
188df9f
to
3f997c2
Compare
I'm not sure why that's failing. That lint should be allowed there. |
The reason appears to be that the test is declared to work with rustfix, but the fixed code fails to compile. |
☔ The latest upstream changes (presumably #6717) made this pull request unmergeable. Please resolve the merge conflicts. |
Having looked into it a bit more from my PC, I can see that line 42 of the fixed test falls afoul of |
There's an |
I think an |
It is on a statement. From #[allow(clippy::option_map_unit_fn)]
Some(String::new()).as_mut().map(|x| x.push_str("")); Is that not supposed to work? There is also a check to make sure #[allow(clippy::option_map_unit_fn)]
match &mut Some(String::new()) {
Some(x) => Some(x.push_str("")),
None => None,
}; |
Yes, I think so. I think it works before statements, not a statement. I don't know the detail, but it seems to work like this when that lint ( |
dcf50b8
to
cad28ec
Compare
cad28ec
to
23aa2f8
Compare
Looks like wrapping it in a block worked. |
Great! Thank you for pushing this to completion! @bors r+ |
📌 Commit 23aa2f8 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
fixes: #6
changelog: Added lint:
match_map