Use impl_add/sub_assign for block interval

We have a macro for implementing `AddAssign` and `SubAssign`.

Use the macro, gets us an additional ref impl for both.
This commit is contained in:
Tobin C. Harding 2025-03-03 13:16:10 +11:00
parent 9d55922952
commit 3ae21d5111
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 2 additions and 7 deletions

View File

@ -223,13 +223,8 @@ crate::internal_macros::impl_op_for_references! {
}
}
impl ops::AddAssign<BlockInterval> for BlockInterval {
fn add_assign(&mut self, rhs: BlockInterval) { self.0 = self.to_u32() + rhs.to_u32(); }
}
impl ops::SubAssign<BlockInterval> for BlockInterval {
fn sub_assign(&mut self, rhs: BlockInterval) { self.0 = self.to_u32() - rhs.to_u32(); }
}
crate::internal_macros::impl_add_assign!(BlockInterval);
crate::internal_macros::impl_sub_assign!(BlockInterval);
impl core::iter::Sum for BlockInterval {
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {