@@ -25,7 +25,7 @@ It is the natural counterpart to `if let`, just as `else` is to regular `if`.
25
25
[ if-let expressions] [ if-let ] offer a succinct syntax for pattern matching single patterns.
26
26
This is particularly useful for unwrapping types like ` Option ` , particularly those with a clear "success" variant
27
27
for the given context but no specific "failure" variant.
28
- However, an if-let expression can only create bindings within its body, which can force
28
+ However, an if-let expression can only create bindings within its body, which can force
29
29
rightward drift, introduce excessive nesting, and separate conditionals from error paths.
30
30
31
31
let-else statements move the "failure" case into the body block, while allowing
@@ -200,9 +200,9 @@ let pattern = expr else {
200
200
```
201
201
desugars to
202
202
``` rust
203
- let (each , binding ) = match expr {
203
+ let (each , binding ) = match expr {
204
204
pattern => (each , binding ),
205
- _ => {
205
+ _ => {
206
206
/* diverging expr */
207
207
}
208
208
};
@@ -262,7 +262,7 @@ let x = match y {
262
262
263
263
## The diverging block
264
264
265
- "Must diverge" is an unusual requirement, which doesn't exist elsewhere in the language as of the time of writing,
265
+ "Must diverge" is an unusual requirement, which doesn't exist elsewhere in the language as of the time of writing,
266
266
and might be difficult to explain or lead to confusing errors for programmers new to this feature.
267
267
268
268
However, rustc does have support for representing the divergence through the type-checker via ` ! ` or any other uninhabited type,
0 commit comments