Merge pull request #1278 from waywardmonkeys/clippy-needless-return

clippy: Fix needless_return warnings.
This commit is contained in:
Andreas Borgen Longva 2023-08-15 11:00:24 +02:00 committed by GitHub
commit 1e40308118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 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<T: Scalar, const D: usize> Scale<T, D> {
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<T: Scalar, const D: usize> Scale<T, D> {
where
T: ClosedDiv + One + Zero,
{
return self
.vector
self.vector
.map(|e| {
if e != T::zero() {
T::one() / e
@ -192,7 +191,7 @@ impl<T: Scalar, const D: usize> Scale<T, D> {
T::zero()
}
})
.into();
.into()
}
/// 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 {
v[i] = self.vector[i].clone();
}
return OMatrix::from_diagonal(&v);
OMatrix::from_diagonal(&v)
}
/// Inverts `self` in-place.