You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can be an enhancement of redundant_clone. And it should share logic with implicit_clone.
As redundant_clone has been moved to the nursery, would it make sense to create a new lint for this?
I don't see how this could trigger false positives.
What it does
When
to_vec()
is called on temporaryVec<_>
the lint should warn thatto_vec()
is not needed and causes extra allocation. (Suggesting removing it.)Categories
What is the advantage of the recommended code over the original code
Vec<_>
)Drawbacks
None.
Example
(playground)
Could be written as:
The text was updated successfully, but these errors were encountered: