1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-27 16:25:43 +02:00

Add "More to Explore" section to struct patterns slide (#2604)

This commit is contained in:
Nicole L 2025-02-05 16:12:01 -08:00 committed by GitHub
parent afe206beab
commit 28ab749338
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)