From 28ab749338c42eaea27e695897ed74cc2197252e Mon Sep 17 00:00:00 2001 From: Nicole L Date: Wed, 5 Feb 2025 16:12:01 -0800 Subject: [PATCH] Add "More to Explore" section to struct patterns slide (#2604) --- src/pattern-matching/destructuring-structs.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pattern-matching/destructuring-structs.md b/src/pattern-matching/destructuring-structs.md index a1fb1a10..9ca9811e 100644 --- a/src/pattern-matching/destructuring-structs.md +++ b/src/pattern-matching/destructuring-structs.md @@ -14,6 +14,9 @@ Like tuples, Struct can also be destructured by matching: - Change the literal values in `foo` to match with the other patterns. - Add a new field to `Foo` and make changes to the pattern as needed. + +## More to Explore + - Try `match &foo` and check the type of captures. The pattern syntax remains the same, but the captures become shared references. This is [match ergonomics](https://rust-lang.github.io/rfcs/2005-match-ergonomics.html)