add link to match section

This commit is contained in:
Alex Burka 2016-04-28 11:47:03 -04:00
parent e1e4fbd2a2
commit 56f24d7c19

View file

@ -179,6 +179,9 @@ let black_r = black.0;
let Point(_, origin_y, origin_z) = origin;
```
Patterns like `Point(_, origin_y, origin_z)` are also used in
[match expressions][match].
One case when a tuple struct is very useful is when it has only one element.
We call this the newtype pattern, because it allows you to create a new type
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
referenced with dot notation as well, a `struct` gives us actual names,
rather than positions.
[match]: match.html
# Unit-like structs
You can define a `struct` with no members at all: