mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-05-17 08:02:38 +02:00
Add "More to Explore" section to struct patterns slide (#2604)
This commit is contained in:
parent
afe206beab
commit
28ab749338
@ -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.
|
- 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.
|
- 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
|
- Try `match &foo` and check the type of captures. The pattern syntax remains
|
||||||
the same, but the captures become shared references. This is
|
the same, but the captures become shared references. This is
|
||||||
[match ergonomics](https://rust-lang.github.io/rfcs/2005-match-ergonomics.html)
|
[match ergonomics](https://rust-lang.github.io/rfcs/2005-match-ergonomics.html)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user