What it does
Suggest the use of Result::unwrap_or_else over Result::map_or_else if map_or_else is just used to unpack a successful result while handling an error.
Categories (optional)
What is the advantage of the recommended code over the original code
Code will be shorter (and cleaner).
Drawbacks
None.
Example
.map_or_else(
|e| handle_the_error(e),
|n| n,
)
Could be written as:
.unwrap_or_else(|e| handle_the_error(e))