enhancement to if_let_some_result: apply to while loops as well #7594
Labels
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
good first issue
These issues are a good way to get started with Clippy
Uh oh!
There was an error while loading. Please reload this page.
What it does
Where
res
is aResult
,should be rewritten as
This could either be an enhancement to
if_let_some_result
or have a new name likewhile_let_some_result
.SEE ALSO: #7586 where previously clippy suggested an incorrect fix (changing while to if). In that thread, @camsteffen suggested creating a new issue for this.
Categories (optional)
style
What is the advantage of the recommended code over the original code
Conciseness etc.
It maintains consistency with the existent
if_let_some_result
and has the same advantages, except now for while loops too.Drawbacks
None.
Example
Could be written as:
The text was updated successfully, but these errors were encountered: