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:
parent
9d55922952
commit
3ae21d5111
|
@ -223,13 +223,8 @@ crate::internal_macros::impl_op_for_references! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ops::AddAssign<BlockInterval> for BlockInterval {
|
crate::internal_macros::impl_add_assign!(BlockInterval);
|
||||||
fn add_assign(&mut self, rhs: BlockInterval) { self.0 = self.to_u32() + rhs.to_u32(); }
|
crate::internal_macros::impl_sub_assign!(BlockInterval);
|
||||||
}
|
|
||||||
|
|
||||||
impl ops::SubAssign<BlockInterval> for BlockInterval {
|
|
||||||
fn sub_assign(&mut self, rhs: BlockInterval) { self.0 = self.to_u32() - rhs.to_u32(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl core::iter::Sum for BlockInterval {
|
impl core::iter::Sum for BlockInterval {
|
||||||
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
|
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
|
||||||
|
|
Loading…
Reference in New Issue