File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,9 @@ let black_r = black.0;
179
179
let Point (_ , origin_y , origin_z ) = origin ;
180
180
```
181
181
182
+ Patterns like ` Point(_, origin_y, origin_z) ` are also used in
183
+ [ match expressions] [ match ] .
184
+
182
185
One case when a tuple struct is very useful is when it has only one element.
183
186
We call this the ‘newtype’ pattern, because it allows you to create a new type
184
187
that is distinct from its contained value and also expresses its own semantic
@@ -224,6 +227,8 @@ Good names are important, and while values in a tuple struct can be
224
227
referenced with dot notation as well, a ` struct ` gives us actual names,
225
228
rather than positions.
226
229
230
+ [ match ] : match.html
231
+
227
232
# Unit-like structs
228
233
229
234
You can define a ` struct ` with no members at all:
You can’t perform that action at this time.
0 commit comments