From 49c6adb0db70ffc30eaac33b66eacf7574b34e26 Mon Sep 17 00:00:00 2001 From: Julian T Date: Wed, 10 Feb 2021 23:06:48 +0100 Subject: Fixed most clippy warnings --- src/core/vector3.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/vector3.rs') diff --git a/src/core/vector3.rs b/src/core/vector3.rs index 24b84e9..e26c07c 100644 --- a/src/core/vector3.rs +++ b/src/core/vector3.rs @@ -117,7 +117,7 @@ impl Vector3f { self.x * self.x + self.y * self.y + self.z * self.z } - pub fn len(&self) -> Float { + pub fn length(&self) -> Float { self.len_squared().sqrt() } @@ -137,7 +137,7 @@ impl Vector3f { /// ``` pub fn norm_in(&mut self) { // TODO Experiment with checking for normality with len_squared - let len = self.len(); + let len = self.length(); if len == 0.0 { *self = Self::new(0.0); } @@ -146,7 +146,7 @@ impl Vector3f { } pub fn norm(&self) -> Self { - let mut new = self.clone(); + let mut new = *self; new.norm_in(); new } -- cgit v1.2.3