Skip to content

Commit

Permalink
Group related trait implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Sep 15, 2022
1 parent 617e4e0 commit 1905104
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crates/fj-math/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,6 @@ impl<T: Into<Scalar>> ops::Add<T> for Scalar {
}
}

impl<T: Into<Scalar>> ops::AddAssign<T> for Scalar {
fn add_assign(&mut self, rhs: T) {
self.0.add_assign(rhs.into().0);
*self = self.0.into();
}
}

impl<T: Into<Scalar>> ops::Sub<T> for Scalar {
type Output = Self;

Expand Down Expand Up @@ -227,6 +220,13 @@ impl<T: Into<Scalar>> ops::Rem<T> for Scalar {
}
}

impl<T: Into<Scalar>> ops::AddAssign<T> for Scalar {
fn add_assign(&mut self, rhs: T) {
self.0.add_assign(rhs.into().0);
*self = self.0.into();
}
}

impl<T: Into<Scalar>> ops::SubAssign<T> for Scalar {
fn sub_assign(&mut self, rhs: T) {
self.0.sub_assign(rhs.into().0);
Expand Down

0 comments on commit 1905104

Please sign in to comment.