1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-09 01:02:47 +02:00

Update if-let-expressions.md (#237)

Mention `let else` in the speaker notes.
This commit is contained in:
Igor Petruk 2023-01-23 18:05:06 +00:00 committed by GitHub
parent 30291800ec
commit 1c36b5d771
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,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.
* 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`.
* Unlike `match`, `if let` does not support guard clauses for pattern matching.