Closed
Description
What it does
Utilizes the new let...else
syntax when the user returns in the non-unwrapping case
Lint Name
let-else-return
Category
style
Advantage
More concise
Drawbacks
No response
Example
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
.