Skip to content

Conversation

@profetia
Copy link
Member

@profetia profetia commented Dec 28, 2025

Closes #14946

Implemented as an enhancement to needless_collect

changelog: [needless_collect] enhance to cover vec push-alike cases

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 28, 2025

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@profetia profetia changed the title Enhance needless_collect to cover vec push Enhance needless_collect to cover vec push-alike Dec 28, 2025
Copy link
Contributor

@llogiq llogiq left a comment

Choose a reason for hiding this comment

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

I think we can improve the suggestion, but otherwise this looks good. Let me know if you want to do the suggestion improvement on this PR or I'll merge it and we can do a followup.

View changes since this review

@profetia
Copy link
Member Author

profetia commented Jan 2, 2026

Emm.., I just realize that push_front can also be handled. I will cover it in this PR.

Comment on lines +222 to +230
LL ~
LL |
LL ~
LL ~
LL ~
LL ~
LL ~
LL ~
LL ~
Copy link
Contributor

Choose a reason for hiding this comment

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

What's up with this? Empty spans perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

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

The pushs are removed in the suggestions, leaving these empty lines

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.

Suggestion of collect_push_then_iter for iterators

3 participants