File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -509,7 +509,7 @@ fn angle(vector: (f64, f64)) -> f64 {
509509 let pi = f64::consts::PI;
510510 match vector {
511511 (0.0, y) if y < 0.0 => 1.5 * pi,
512- (0.0, y ) => 0.5 * pi,
512+ (0.0, _ ) => 0.5 * pi,
513513 (x, y) => atan(y / x)
514514 }
515515}
@@ -519,7 +519,9 @@ A variable name in a pattern matches any value, *and* binds that name
519519to the value of the matched value inside of the arm's action. Thus, `(0.0,
520520y)` matches any tuple whose first element is zero, and binds ` y` to
521521the second element. ` (x, y) ` matches any two-element tuple, and binds both
522- elements to variables.
522+ elements to variables. ` (0.0,_) ` matches any tuple whose first element is zero
523+ and does not bind anything to the second element.
524+
523525A subpattern can also be bound to a variable, using ` variable @ pattern ` . For
524526example:
525527
You can’t perform that action at this time.
0 commit comments