diff options
author | Julian T <julian@jtle.dk> | 2021-02-10 23:06:48 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-02-10 23:06:48 +0100 |
commit | 49c6adb0db70ffc30eaac33b66eacf7574b34e26 (patch) | |
tree | 60f828ce8abf962fe2d88fdeb4e04db1d7663253 /src/core/vector3.rs | |
parent | 3a144c8c1fc83150fc06d792082db5cc4bce3cc5 (diff) |
Fixed most clippy warnings
Diffstat (limited to 'src/core/vector3.rs')
-rw-r--r-- | src/core/vector3.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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 } |