From 18f016cba70bf59095ae65ce0e289d80a548ae58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 20 Mar 2020 04:08:18 +0100 Subject: [PATCH] Use `f32::hypot` in `Point::distance` --- core/src/point.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/point.rs b/core/src/point.rs index b855cd91..43ee2143 100644 --- a/core/src/point.rs +++ b/core/src/point.rs @@ -30,7 +30,7 @@ impl Point { let a = self.x - to.x; let b = self.y - to.y; - f32::sqrt(a * a + b * b) + a.hypot(b) } }