From 76866ad8780facb01cd22a6967f3dee74afa6be4 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 15 Aug 2023 14:34:34 +0700 Subject: [PATCH] clippy: Fix needless_return warnings. --- src/geometry/scale.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/geometry/scale.rs b/src/geometry/scale.rs index c95c0967..86122b9d 100644 --- a/src/geometry/scale.rs +++ b/src/geometry/scale.rs @@ -129,7 +129,7 @@ impl Scale { return None; } } - return Some(self.vector.map(|e| T::one() / e).into()); + Some(self.vector.map(|e| T::one() / e).into()) } /// Inverts `self`. @@ -155,7 +155,7 @@ impl Scale { where T: ClosedDiv + One, { - return self.vector.map(|e| T::one() / e).into(); + self.vector.map(|e| T::one() / e).into() } /// Inverts `self`. @@ -183,8 +183,7 @@ impl Scale { where T: ClosedDiv + One + Zero, { - return self - .vector + self.vector .map(|e| { if e != T::zero() { T::one() / e @@ -192,7 +191,7 @@ impl Scale { T::zero() } }) - .into(); + .into() } /// Converts this Scale into its equivalent homogeneous transformation matrix. @@ -230,7 +229,7 @@ impl Scale { for i in 0..D { v[i] = self.vector[i].clone(); } - return OMatrix::from_diagonal(&v); + OMatrix::from_diagonal(&v) } /// Inverts `self` in-place.