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

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

The use of "interesting" here made the sentence unclear to our Localization team.
This commit is contained in:
Martin Geisler 2023-06-22 16:27:34 +02:00 committed by GitHub
parent aba7fd7f56
commit b7469f779e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,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.
* Unlike `match`, `if let` does not have to cover all branches. This can make it more concise than `match`.
* A common usage is handling `Some` values when working with `Option`.
* Unlike `match`, `if let` does not support guard clauses for pattern matching.
* Since 1.65, a similar [let-else](https://doc.rust-lang.org/rust-by-example/flow_control/let_else.html) construct allows to do a destructuring assignment, or if it fails, have a non-returning block branch (panic/return/break/continue):