Option::and_then(|v| ...(&v).then_some(v))
to Option::filter(|v| ...(v))
#12978
Labels
A-lint
Area: New lints
Uh oh!
There was an error while loading. Please reload this page.
What it does
Improve the code to be more concise
Advantage
Drawbacks
No response
Example
Could be written as:
The text was updated successfully, but these errors were encountered: