Skip to content

Commit 94ed176

Browse files
authored
Update destructuring-enums.md (#231)
1 parent ef119bc commit 94ed176

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/pattern-matching/destructuring-enums.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ fn main() {
2929
Here we have used the arms to _destructure_ the `Result` value. In the first
3030
arm, `half` is bound to the value inside the `Ok` variant. In the second arm,
3131
`msg` is bound to the error message.
32+
33+
<details>
34+
35+
Consider demonstrating what happens if you add the third enum variant. Rust
36+
will try to be helpful and the code won't compile, because you haven't handled
37+
the new case in your match statements.
38+
39+
</details>

0 commit comments

Comments
 (0)