Merge rust-bitcoin/rust-bitcoin#4014: Return `Self::Output` from `ops::Rem`
94f9bac6aa
Return Self::Output from ops::Rem (Tobin C. Harding) Pull request description: 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`. ACKs for top commit: Kixunil: ACK94f9bac6aa
apoelstra: ACK 94f9bac6aadec17bbda66f7ad23a970fccdd840e; successfully ran local tests Tree-SHA512: da609b7963e80f9a6550bfdb80c0ab465ab16caa3f95c92b1b3272378cf23656feb9ac5de4ed457ef9e2109b19e2721ee3b1314f0e602851378194d5f6b28850
This commit is contained in:
commit
170fad53c0
|
@ -502,7 +502,7 @@ crate::internal_macros::impl_sub_assign!(SignedAmount);
|
|||
impl ops::Rem<i64> 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")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -445,7 +445,7 @@ crate::internal_macros::impl_sub_assign!(Amount);
|
|||
impl ops::Rem<u64> 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")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue