Skip to content

[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

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

y21
Copy link
Member

@y21 y21 commented Jun 12, 2023

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 not vec![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 on vec![_] invocations that adjust to a slice

@rustbot
Copy link
Collaborator

rustbot commented Jun 12, 2023

r? @Manishearth

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 12, 2023
@Manishearth
Copy link
Member

r? @Centri3 since you reviewed the first one

@rustbot
Copy link
Collaborator

rustbot commented Jun 12, 2023

Failed to set assignee to Centri3: invalid assignee

Note: Only org members, users with write permissions, or people who have commented on the PR may be assigned.

@Manishearth
Copy link
Member

@bors delegate=Centri3

@bors
Copy link
Contributor

bors commented Jun 12, 2023

✌️ @Centri3, you can now approve this pull request!

If @Manishearth told you to "r=me" after making some further change, please make that change, then do @bors r=@Manishearth

@Centri3
Copy link
Member

Centri3 commented Jun 12, 2023

Will take a look in a bit :)

Copy link
Member

@Centri3 Centri3 left a 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?

@Manishearth
Copy link
Member

@bors r=Centri3

thanks!

@bors
Copy link
Contributor

bors commented Jun 12, 2023

📌 Commit 50ba459 has been approved by Centri3

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jun 12, 2023

⌛ Testing commit 50ba459 with merge da56c35...

@bors
Copy link
Contributor

bors commented Jun 12, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Centri3
Pushing da56c35 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lint uses of Vec where arrays would do fine
5 participants