mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-31 11:01:46 +02:00
Update if-let-expressions.md (#854)
The use of "interesting" here made the sentence unclear to our Localization team.
This commit is contained in:
parent
aba7fd7f56
commit
b7469f779e
@ -20,7 +20,7 @@ Rust.
|
||||
|
||||
<details>
|
||||
|
||||
* `if let` can be more concise than `match`, e.g., when only one case is interesting. In contrast, `match` requires all branches to be covered.
|
||||
* Unlike `match`, `if let` does not have to cover all branches. This can make it more concise than `match`.
|
||||
* A common usage is handling `Some` values when working with `Option`.
|
||||
* Unlike `match`, `if let` does not support guard clauses for pattern matching.
|
||||
* Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-example/flow_control/let_else.html) construct allows to do a destructuring assignment, or if it fails, have a non-returning block branch (panic/return/break/continue):
|
||||
|
Loading…
x
Reference in New Issue
Block a user