Reports an if statement that evaluates to Option
and suggests replacing it with filter
.
Example:
def condition(x: Int): Boolean = ???
val value = 3
if (condition(value)) Some(value) else None
After the quick-fix is applied:
def condition(x: Int): Boolean = ???
val value = 3
Some(value).filter(condition)