-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
A-lintArea: New lintsArea: New lints
Description
What it does
Propose to change iter() to into_iter()
Categories (optional)
- Kind: See https://github.com/rust-lang/rust-clippy/blob/master/README.md#clippy for list of lint kinds
What is the advantage of the recommended code over the original code
For example:
My old code:
foo.unwrap_or_default().iter()....
By hand I changed it to:
foo.unwrap_or_default().into_iter()....
Then clippy proposed to remove some clone()s
When I removed the clone()s, clippy proposed to change filter + map to filter_map
clippy is awesome. The code looks beautiful now.
The suggestion to change iter() to into_iter() was missing and blocking the other lints
Drawbacks
None.
Example
foo.unwrap_or_default().iter()....Could be written as:
foo.unwrap_or_default().into_iter()....fenollp and schneiderfelipe
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lints