File tree 1 file changed +4
-2
lines changed
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 {
509
509
let pi = f64::consts::PI;
510
510
match vector {
511
511
(0.0, y) if y < 0.0 => 1.5 * pi,
512
- (0.0, y ) => 0.5 * pi,
512
+ (0.0, _ ) => 0.5 * pi,
513
513
(x, y) => atan(y / x)
514
514
}
515
515
}
@@ -519,7 +519,9 @@ A variable name in a pattern matches any value, *and* binds that name
519
519
to the value of the matched value inside of the arm's action. Thus, `(0.0,
520
520
y)` matches any tuple whose first element is zero, and binds ` y` to
521
521
the 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
+
523
525
A subpattern can also be bound to a variable, using ` variable @ pattern ` . For
524
526
example:
525
527
You can’t perform that action at this time.
0 commit comments