-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix as_deref_mut
false positives in needless_option_as_deref
#8646
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
Conversation
r? @giraffate (rust-highfive has picked a reviewer for you, use r? to override) |
☔ The latest upstream changes (presumably #8606) made this pull request unmergeable. Please resolve the merge conflicts. |
4f36767
to
868072f
Compare
clippy_lints/src/methods/mod.rs
Outdated
@@ -2106,6 +2107,30 @@ declare_clippy_lint! { | |||
"using `.collect::<Vec<String>>().join(\"\")` on an iterator" | |||
} | |||
|
|||
declare_clippy_lint! { | |||
/// ### What it does | |||
/// Checks for no-op uses of Option::{as_deref,as_deref_mut}, |
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.
nits
/// Checks for no-op uses of Option::{as_deref,as_deref_mut}, | |
/// Checks for no-op uses of `Option::{as_deref,as_deref_mut}`, |
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.
👍 Changed
Also moves the lint to the methods directory
868072f
to
182b7c3
Compare
@bors r+ It looks good, thanks! |
📌 Commit 182b7c3 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Check for loops/closures in `local_used_after_expr` Follow up to #8646, catches when a local is used multiple times because it's in a loop or a closure changelog: none
Also moves it into
methods/
Fixes #7846
Fixes #8047
changelog: [
needless_option_as_deref
]: No longer lints foras_deref_mut
on Options that cannot be movedsupersedes #8064