about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-02-05 03:16:35 -0800
committerbors <bors@rust-lang.org>2014-02-05 03:16:35 -0800
commited885e35fe91c12892bbf1254b4bc6259cc96eee (patch)
tree72ed11902341e20cdfea4e77749d8a667a4554bf /src
parent53864ce5121b1b36679dfb901f85a98172cde19b (diff)
parent87d026b76e9f389497aa48b23755d88a18127757 (diff)
downloadrust-ed885e35fe91c12892bbf1254b4bc6259cc96eee.tar.gz
rust-ed885e35fe91c12892bbf1254b4bc6259cc96eee.zip
auto merge of #12035 : chromatic/rust/tutorial_improvements, r=alexcrichton
This cleans up a warning about an unused variable and explains the code
further.
Diffstat (limited to 'src')
-rw-r--r--src/doc/tutorial.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/doc/tutorial.md b/src/doc/tutorial.md
index a7696b45405..75a5840a1ef 100644
--- a/src/doc/tutorial.md
+++ b/src/doc/tutorial.md
@@ -509,7 +509,7 @@ fn angle(vector: (f64, f64)) -> f64 {
     let pi = f64::consts::PI;
     match vector {
       (0.0, y) if y < 0.0 => 1.5 * pi,
-      (0.0, y) => 0.5 * pi,
+      (0.0, _) => 0.5 * pi,
       (x, y) => atan(y / x)
     }
 }
@@ -519,7 +519,9 @@ A variable name in a pattern matches any value, *and* binds that name
 to the value of the matched value inside of the arm's action. Thus, `(0.0,
 y)` matches any tuple whose first element is zero, and binds `y` to
 the second element. `(x, y)` matches any two-element tuple, and binds both
-elements to variables.
+elements to variables. `(0.0,_)` matches any tuple whose first element is zero
+and does not bind anything to the second element.
+
 A subpattern can also be bound to a variable, using `variable @ pattern`. For
 example: