Skip to content

Conversation

@y21
Copy link
Member

@y21 y21 commented May 26, 2023

Closes #10818.

This adds a new lint that looks for .drain(..).collect() and suggests replacing it with mem::take.

changelog: [drain_collect]: new lint

@rustbot
Copy link
Collaborator

rustbot commented May 26, 2023

r? @dswij

(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 May 26, 2023
@y21 y21 force-pushed the drain-collect branch from 7f45a5d to 39a304c Compare May 26, 2023 23:37
@bors
Copy link
Contributor

bors commented Jun 12, 2023

☔ The latest upstream changes (presumably #10358) made this pull request unmergeable. Please resolve the merge conflicts.

@dswij dswij added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jun 15, 2023
@y21 y21 force-pushed the drain-collect branch from cda5c9c to 5821fbb Compare June 15, 2023 18:24
Copy link
Member

@dswij dswij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for this!

@dswij
Copy link
Member

dswij commented Jun 16, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Jun 16, 2023

📌 Commit 5821fbb has been approved by dswij

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jun 16, 2023

⌛ Testing commit 5821fbb with merge ee67c79...

@bors
Copy link
Contributor

bors commented Jun 16, 2023

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

@bors bors merged commit ee67c79 into rust-lang:master Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new lint: avoid vec.drain(..).collect() in favor of std::mem::take(&mut vec)

4 participants