From 40652b641508b24bb670b7da66001192a7fe65e0 Mon Sep 17 00:00:00 2001 From: Nicole L Date: Thu, 26 Jun 2025 12:01:04 -0700 Subject: [PATCH] Add note about struct-style enum variants in pattern matching (#2784) Can't forget to demonstrate struct-style enum variants when talking about pattern matching. --- src/pattern-matching/destructuring-enums.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pattern-matching/destructuring-enums.md b/src/pattern-matching/destructuring-enums.md index f9e30c42..81e3202c 100644 --- a/src/pattern-matching/destructuring-enums.md +++ b/src/pattern-matching/destructuring-enums.md @@ -47,5 +47,8 @@ arm, `half` is bound to the value inside the `Ok` variant. In the second arm, matched. - Demonstrate what happens when the search is inexhaustive. Note the advantage the Rust compiler provides by confirming when all cases are handled. +- Demonstrate the syntax for a struct-style variant by adding one to the enum + definition and the `match`. Point out how this is syntactically similar to + matching on a struct.