Suggest replacing pattern matching with map
or map_err
#8436
Labels
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
What it does
This is in some way an extension to
redundant_pattern_matching
lint. The lint flags pattern matching that can be trivially converted tomap
ormap_err
invocations.Lint Name
extend
redundant_pattern_matching
orprefer_map_over_pattern_match
Category
style
Advantage
Drawbacks
Depending on the code base this lint can be very intrusive.
Example
Could be written as:
Could be written as:
Could be written as:
The text was updated successfully, but these errors were encountered: