Skip to content

Commit

Permalink
Add "More to Explore" section to struct patterns slide
Browse files Browse the repository at this point in the history
  • Loading branch information
randomPoison committed Jan 31, 2025
1 parent 347de61 commit 320a410
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pattern-matching/destructuring-structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 320a410

Please sign in to comment.