Skip to content

Commit

Permalink
Update if-let-expressions.md (google#237)
Browse files Browse the repository at this point in the history
Mention `let else` in the speaker notes.
  • Loading branch information
igor-petruk authored and NoahDragon committed Jul 11, 2023
1 parent 72cf387 commit a96031d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/control-flow/if-let-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit a96031d

Please sign in to comment.