-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Enhance needless_collect to cover vec push-alike
#16305
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
needless_collect to cover vec pushneedless_collect to cover vec push-alike
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 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.
|
Emm.., I just realize that |
| LL ~ | ||
| LL | | ||
| LL ~ | ||
| LL ~ | ||
| LL ~ | ||
| LL ~ | ||
| LL ~ | ||
| LL ~ | ||
| LL ~ |
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.
What's up with this? Empty spans perhaps?
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.
The pushs are removed in the suggestions, leaving these empty lines
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.
In that case, unless there is something non-whitespace between the spans, we may want to combine them into one span.
But again, that doesn't need to be in this PR.
|
Ok, we can merge this and create follow-up PRs for further changes. Thank you! |
Closes rust-lang#14946 Implemented as an enhancement to `needless_collect` changelog: [`needless_collect`] enhance to cover vec `push`-alike cases
Closes #14946
Implemented as an enhancement to
needless_collectchangelog: [
needless_collect] enhance to cover vecpush-alike cases