From f5e17914b6698e4b08e80aef7f2276e6897b0843 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 3 Mar 2025 13:09:10 +1100 Subject: [PATCH] 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. --- units/src/block.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/units/src/block.rs b/units/src/block.rs index 9e8475db4..af4d30b41 100644 --- a/units/src/block.rs +++ b/units/src/block.rs @@ -211,10 +211,6 @@ impl ops::Add for BlockInterval { } } -impl ops::AddAssign for BlockInterval { - fn add_assign(&mut self, rhs: BlockInterval) { self.0 = self.to_u32() + rhs.to_u32(); } -} - // interval - interval = interval impl ops::Sub for BlockInterval { type Output = BlockInterval; @@ -225,6 +221,10 @@ impl ops::Sub for BlockInterval { } } +impl ops::AddAssign for BlockInterval { + fn add_assign(&mut self, rhs: BlockInterval) { self.0 = self.to_u32() + rhs.to_u32(); } +} + impl ops::SubAssign for BlockInterval { fn sub_assign(&mut self, rhs: BlockInterval) { self.0 = self.to_u32() - rhs.to_u32(); } }