mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-09 09:11:50 +02:00
Update if-let-expressions.md (#237)
Mention `let else` in the speaker notes.
This commit is contained in:
parent
30291800ec
commit
1c36b5d771
@ -19,6 +19,7 @@ Rust.
|
|||||||
<details>
|
<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.
|
* `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.
|
||||||
|
* For the similar use case consider demonstrating a newly stabilized [`let else`](https://github.com/rust-lang/rust/pull/93628) feature.
|
||||||
* A common usage is handling `Some` values when working with `Option`.
|
* A common usage is handling `Some` values when working with `Option`.
|
||||||
* Unlike `match`, `if let` does not support guard clauses for pattern matching.
|
* Unlike `match`, `if let` does not support guard clauses for pattern matching.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user