Skip to content

Commit a2cb70a

Browse files
committed
Update UPB-CS-OpenSourceUpstream#2, am adaugat restul tipurilor, fiecare avand sectiune de cod cu exemple
1 parent fafc737 commit a2cb70a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lessons/en/chapter_2.yaml

+15-1
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,25 @@
106106
Deconstructing 'tuples' allows us to extract individual elements from the group.
107107
code: >-
108108
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=330cce03a942deef101e8a818e09368a
109-
- title: Destructing arrays/slices
109+
- title: Destructuring Arrays/Slices
110110
content_markdown: >
111111
'Arrays' and 'slices' in Rust can be destructured similarly.
112112
code: >-
113113
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
114128
- title: Returning Values From loop
115129
content_markdown: |
116130
`loop` can break to return a value.

0 commit comments

Comments
 (0)