From 56f24d7c193da3b972994e24b86e1fd63e1e8c9e Mon Sep 17 00:00:00 2001 From: Alex Burka Date: Thu, 28 Apr 2016 11:47:03 -0400 Subject: [PATCH] add link to match section --- src/doc/book/structs.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/doc/book/structs.md b/src/doc/book/structs.md index eace99670b1e..1fb74e33a622 100644 --- a/src/doc/book/structs.md +++ b/src/doc/book/structs.md @@ -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: