diff --git a/units/src/amount/signed.rs b/units/src/amount/signed.rs index aece125bd..99602eca9 100644 --- a/units/src/amount/signed.rs +++ b/units/src/amount/signed.rs @@ -502,7 +502,7 @@ crate::internal_macros::impl_sub_assign!(SignedAmount); impl ops::Rem for SignedAmount { type Output = SignedAmount; - fn rem(self, modulus: i64) -> Self { + fn rem(self, modulus: i64) -> Self::Output { self.checked_rem(modulus).expect("SignedAmount remainder error") } } diff --git a/units/src/amount/unsigned.rs b/units/src/amount/unsigned.rs index e80f5c6b7..645dbe9d8 100644 --- a/units/src/amount/unsigned.rs +++ b/units/src/amount/unsigned.rs @@ -445,7 +445,7 @@ crate::internal_macros::impl_sub_assign!(Amount); impl ops::Rem for Amount { type Output = Amount; - fn rem(self, modulus: u64) -> Self { + fn rem(self, modulus: u64) -> Self::Output { self.checked_rem(modulus).expect("Amount remainder error") } }