Closed
Description
What it does
Catch Some(..).and_then(|..| Some(..))
patterns.
What does this lint do?
Suggest to simplify the statement to Some(do something with x and y)
For example Some(3).and_then(|x| Some(x+4));
could be simplified to Some(3+4)
Categories (optional)
Complexity, maybe pedantic.
What is the advantage of the recommended code over the original code
It's way easier to understand
Drawbacks
None.
Example
Some(3).and_then(|x| Some(x+4));
Could be written as:
Some(3+4)