mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-12-11 13:18:43 +02:00
Add speaker notes for if-let-expressions.md
This commit is contained in:
parent
20c0a37949
commit
d42f0dcd46
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user