Return Self::Output from ops::Rem

The ops traits return `Self::Output` not `Self`. The current code builds
because `Self` and `Self::Output` are both the same type.

Use `Self::Output` as the return value of `ops::Rem`.
This commit is contained in:
Tobin C. Harding 2025-02-04 09:17:59 +11:00
parent 786e835312
commit 94f9bac6aa
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
2 changed files with 2 additions and 2 deletions

View File

@ -502,7 +502,7 @@ crate::internal_macros::impl_sub_assign!(SignedAmount);
impl ops::Rem<i64> for SignedAmount { impl ops::Rem<i64> for SignedAmount {
type Output = 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") self.checked_rem(modulus).expect("SignedAmount remainder error")
} }
} }

View File

@ -445,7 +445,7 @@ crate::internal_macros::impl_sub_assign!(Amount);
impl ops::Rem<u64> for Amount { impl ops::Rem<u64> for Amount {
type Output = 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") self.checked_rem(modulus).expect("Amount remainder error")
} }
} }