We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
let...else
return
match
Utilizes the new let...else syntax when the user returns in the non-unwrapping case
let-else-return
style
More concise
No response
let n = match some_option { Some(n) => n, None => return something_else, };
Or
let n = if let Some(n) = some_option { n } else { return something_else; };
Could be written as:
let Some(n) = some_option else { return something_else, };
Ideally this would also work with Result.
Result
The text was updated successfully, but these errors were encountered:
I think you are looking for #8437. It is not in nightly yet, but will be after the the next clippy bump.
Sorry, something went wrong.
No branches or pull requests
What it does
Utilizes the new
let...else
syntax when the user returns in the non-unwrapping caseLint Name
let-else-return
Category
style
Advantage
More concise
Drawbacks
No response
Example
Or
Could be written as:
Ideally this would also work with
Result
.The text was updated successfully, but these errors were encountered: