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:
parent
786e835312
commit
94f9bac6aa
|
@ -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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue