From 94ed176761706a181387b520318b8ef398233e71 Mon Sep 17 00:00:00 2001 From: Igor Petruk Date: Mon, 23 Jan 2023 11:40:02 +0000 Subject: [PATCH] Update destructuring-enums.md (#231) --- src/pattern-matching/destructuring-enums.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pattern-matching/destructuring-enums.md b/src/pattern-matching/destructuring-enums.md index 33673db0..b737e55f 100644 --- a/src/pattern-matching/destructuring-enums.md +++ b/src/pattern-matching/destructuring-enums.md @@ -29,3 +29,11 @@ fn main() { Here we have used the arms to _destructure_ the `Result` value. In the first arm, `half` is bound to the value inside the `Ok` variant. In the second arm, `msg` is bound to the error message. + +
+ +Consider demonstrating what happens if you add the third enum variant. Rust +will try to be helpful and the code won't compile, because you haven't handled +the new case in your match statements. + +