-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[useless_vec
]: lint on vec![_]
invocations that adjust to a slice
#10933
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? @Manishearth (rustbot has picked a reviewer for you, use r? to override) |
r? @Centri3 since you reviewed the first one |
Failed to set assignee to
|
@bors delegate=Centri3 |
✌️ @Centri3, you can now approve this pull request! If @Manishearth told you to " |
Will take a look in a bit :) |
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 looks great, thanks! @Manishearth, can you take a quick look just in case I missed something?
@bors r=Centri3 thanks! |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fixes #2262 (well, actually my PR over at #10901 did do most of the stuff, but this PR implements the one last other case mentioned in the comments that my PR didn't fix)
Before this change, it would lint
(&vec![1]).iter().sum::<i32>()
, but notvec![1].iter().sum::<i32>()
. This PR handles this case.This also refactors a few things that I wanted to do in my other PR but forgot about.
changelog: [
useless_vec
]: lint onvec![_]
invocations that adjust to a slice