Skip to content

Commit 56f24d7

Browse files
committed
add link to match section
1 parent e1e4fbd commit 56f24d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/doc/book/structs.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ let black_r = black.0;
179179
let Point(_, origin_y, origin_z) = origin;
180180
```
181181

182+
Patterns like `Point(_, origin_y, origin_z)` are also used in
183+
[match expressions][match].
184+
182185
One case when a tuple struct is very useful is when it has only one element.
183186
We call this the ‘newtype’ pattern, because it allows you to create a new type
184187
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
224227
referenced with dot notation as well, a `struct` gives us actual names,
225228
rather than positions.
226229

230+
[match]: match.html
231+
227232
# Unit-like structs
228233

229234
You can define a `struct` with no members at all:

0 commit comments

Comments
 (0)