You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the new let-else syntax is introduced, it would be awesome to have a lint which detects match and if-let statements which could be improved with let-else.
Categories (optional)
Kind: clippy::style
What is the advantage of the recommended code over the original code
It's more concise and idiomatic.
Drawbacks
None.
Example
let foo = match expr1 {Some(foo) => foo,None => {// error handling codereturn;}};let bar = ifletSome(bar) = expr2 {
bar
}else{// error handling codereturn;};
What it does
Once the new let-else syntax is introduced, it would be awesome to have a lint which detects match and if-let statements which could be improved with let-else.
Categories (optional)
What is the advantage of the recommended code over the original code
It's more concise and idiomatic.
Drawbacks
None.
Example
Could be written as:
The text was updated successfully, but these errors were encountered: