File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 106
106
Deconstructing 'tuples' allows us to extract individual elements from the group.
107
107
code : >-
108
108
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=330cce03a942deef101e8a818e09368a
109
- - title : Destructing arrays/slices
109
+ - title : Destructuring Arrays/Slices
110
110
content_markdown : >
111
111
'Arrays' and 'slices' in Rust can be destructured similarly.
112
112
code : >-
113
113
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=2b4e115dfcc4e0ecfdc6da202f9b7dd9
114
+ - title : Destructuring Enums
115
+ content_markdown : >
116
+ 'Enums' require a little more effort, since they have multiple
117
+
118
+ fields of different types.
119
+ code : >-
120
+ https://play.rust-lang.org/?version=beta&mode=debug&edition=2015&gist=fb9a2b07856cca58228e1a4f7052aea6
121
+ - title : Destructuring Structs
122
+ content_markdown : >
123
+ 'Structs' DO NOT NEED match blocks to be destructured, but destructuring
124
+
125
+ them works on the same logic as those before.
126
+ code : >-
127
+ https://play.rust-lang.org/?version=beta&mode=debug&edition=2015&gist=b5ec9bcb420987e46639bd4f8c1a06db
114
128
- title : Returning Values From loop
115
129
content_markdown : |
116
130
`loop` can break to return a value.
You can’t perform that action at this time.
0 commit comments