clippy: Fix needless_return warnings.

This commit is contained in:
Bruce Mitchener 2023-08-15 14:34:34 +07:00
parent 6ac9d8995c
commit 76866ad878
1 changed files with 5 additions and 6 deletions

View File

@ -129,7 +129,7 @@ impl<T: Scalar, const D: usize> Scale<T, D> {
return None; return None;
} }
} }
return Some(self.vector.map(|e| T::one() / e).into()); Some(self.vector.map(|e| T::one() / e).into())
} }
/// Inverts `self`. /// Inverts `self`.
@ -155,7 +155,7 @@ impl<T: Scalar, const D: usize> Scale<T, D> {
where where
T: ClosedDiv + One, T: ClosedDiv + One,
{ {
return self.vector.map(|e| T::one() / e).into(); self.vector.map(|e| T::one() / e).into()
} }
/// Inverts `self`. /// Inverts `self`.
@ -183,8 +183,7 @@ impl<T: Scalar, const D: usize> Scale<T, D> {
where where
T: ClosedDiv + One + Zero, T: ClosedDiv + One + Zero,
{ {
return self self.vector
.vector
.map(|e| { .map(|e| {
if e != T::zero() { if e != T::zero() {
T::one() / e T::one() / e
@ -192,7 +191,7 @@ impl<T: Scalar, const D: usize> Scale<T, D> {
T::zero() T::zero()
} }
}) })
.into(); .into()
} }
/// Converts this Scale into its equivalent homogeneous transformation matrix. /// Converts this Scale into its equivalent homogeneous transformation matrix.
@ -230,7 +229,7 @@ impl<T: Scalar, const D: usize> Scale<T, D> {
for i in 0..D { for i in 0..D {
v[i] = self.vector[i].clone(); v[i] = self.vector[i].clone();
} }
return OMatrix::from_diagonal(&v); OMatrix::from_diagonal(&v)
} }
/// Inverts `self` in-place. /// Inverts `self` in-place.