Fix E0165 code examples
This commit is contained in:
parent
298730e703
commit
c34676a7c4
1 changed files with 4 additions and 3 deletions
|
@ -384,18 +384,19 @@ let irr = Irrefutable(0);
|
|||
|
||||
// This fails to compile because the match is irrefutable.
|
||||
while let Irrefutable(x) = irr {
|
||||
...
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
Try this instead:
|
||||
|
||||
```
|
||||
```no_run
|
||||
struct Irrefutable(i32);
|
||||
let irr = Irrefutable(0);
|
||||
|
||||
loop {
|
||||
let Irrefutable(x) = irr;
|
||||
...
|
||||
// ...
|
||||
}
|
||||
```
|
||||
"##,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue