Skip to content

Commit f5e1791

Browse files
committed
Move Assign impls together
Next patch will move all the impls of `Add` and `Sub` into a macro call. In order to make that patch smaller move the assign impls to be together below the add/sub impls. Code move only, no logic change.
1 parent cc66838 commit f5e1791

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

units/src/block.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,6 @@ impl ops::Add<BlockInterval> for BlockInterval {
211211
}
212212
}
213213

214-
impl ops::AddAssign<BlockInterval> for BlockInterval {
215-
fn add_assign(&mut self, rhs: BlockInterval) { self.0 = self.to_u32() + rhs.to_u32(); }
216-
}
217-
218214
// interval - interval = interval
219215
impl ops::Sub<BlockInterval> for BlockInterval {
220216
type Output = BlockInterval;
@@ -225,6 +221,10 @@ impl ops::Sub<BlockInterval> for BlockInterval {
225221
}
226222
}
227223

224+
impl ops::AddAssign<BlockInterval> for BlockInterval {
225+
fn add_assign(&mut self, rhs: BlockInterval) { self.0 = self.to_u32() + rhs.to_u32(); }
226+
}
227+
228228
impl ops::SubAssign<BlockInterval> for BlockInterval {
229229
fn sub_assign(&mut self, rhs: BlockInterval) { self.0 = self.to_u32() - rhs.to_u32(); }
230230
}

0 commit comments

Comments
 (0)