Skip to content

Commit 54babf8

Browse files
committed
Guide: Fix use of sqrt() in example
1 parent 58dc0a0 commit 54babf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/doc/guide-lifetimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ a reference.
5656
fn compute_distance(p1: &Point, p2: &Point) -> f64 {
5757
let x_d = p1.x - p2.x;
5858
let y_d = p1.y - p2.y;
59-
sqrt(x_d * x_d + y_d * y_d)
59+
(x_d * x_d + y_d * y_d).sqrt()
6060
}
6161
~~~
6262

0 commit comments

Comments
 (0)