-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
A-lintArea: New lintsArea: New lintsgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
What it does
Checks for usage of vec.drain(..)
(iterator dropped immediately) which can be replaced with vec.clear()
Lint Name
unnecessary_vec_drain
Category
style
Advantage
- Makes intent clearer
- Marginally more efficient, especially in debug builds
Drawbacks
No response
Example
vec.drain(..);
Could be written as:
vec.clear();
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy