Skip to content

Commit

Permalink
Merge pull request #1278 from waywardmonkeys/clippy-needless-return
Browse files Browse the repository at this point in the history
clippy: Fix needless_return warnings.
  • Loading branch information
Andlon authored Aug 15, 2023
2 parents 6ac9d89 + 76866ad commit 1e40308
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/geometry/scale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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`.
Expand Down Expand Up @@ -183,16 +183,15 @@ 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
} else {
T::zero()
}
})
.into();
.into()
}

/// Converts this Scale into its equivalent homogeneous transformation matrix.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 1e40308

Please sign in to comment.