-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
A-lintArea: New lintsArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.
Description
What it does
Eliminate map
to bool
if it is before a call to all
/any
Categories (optional)
What is the advantage of the recommended code over the original code
Shorter code.
Drawbacks
If the map
operation has side-effect, applying the suggestion will change the meaning of the program.
Example
iter
.map(|value| value > 0)
.all(|x| x)
Could be written as:
iter.all(|value| value > 0)
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.