-
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_as_ref_cloned
#12051
Conversation
r? @dswij (rustbot has picked a reviewer for you, use r? to override) |
Extended it to also cover |
☔ The latest upstream changes (presumably #12054) made this pull request unmergeable. Please resolve the merge conflicts. |
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 for this! Looks pretty straightforward.
Can you help to rebase this to master? I think it's good to merge afterward.
f88b899
to
692ec68
Compare
Thank you! @bors r+ |
new lint: `option_as_ref_cloned` Closes #12009 Adds a new lint that looks for `.as_ref().cloned()` on `Option`s. That's the same as just `.clone()`-ing the option directly. changelog: new lint: [`option_as_ref_cloned`]
💔 Test failed - checks-action_dev_test |
@y21 seems like you need to run |
That's odd... That command doesn't change anything and |
692ec68
to
9837a03
Compare
9837a03
to
5960107
Compare
@@ -5,7 +5,7 @@ | |||
|
|||
A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code. | |||
|
|||
[There are over 650 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html) | |||
[There are over 700 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html) |
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.
🎉
Looks like this is what caused CI to fail, it wanted this updated
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'm quite surprised that we have this check.
But, did we surpass the 700 milestone with this? 🎉
Let's try again @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Thanks! |
Closes #12009
Adds a new lint that looks for
.as_ref().cloned()
onOption
s. That's the same as just.clone()
-ing the option directly.changelog: new lint: [
option_as_ref_cloned
]