1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-04 03:25:08 +02:00

Merge pull request #148 from fbornhofen/speaker-notes-if-let

Add speaker notes for if-let-expressions.md
This commit is contained in:
Martin Geisler 2023-01-10 18:58:53 +01:00 committed by GitHub
commit 4e746482f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,3 +15,11 @@ fn main() {
See [pattern matching](../pattern-matching.md) for more details on patterns in
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.
* A common usage is handling `Some` values when working with `Option`.
* Unlike `match`, `if let` does not support guard clauses for pattern matching.
</details>