diff --git a/src/instruction.rs b/src/instruction.rs index 527f6df..00ce7ea 100644 --- a/src/instruction.rs +++ b/src/instruction.rs @@ -2136,12 +2136,30 @@ impl std::ops::Rem for Cycles { } } +impl std::ops::RemAssign for Cycles { + fn rem_assign(&mut self, rhs: Self) { + *self = Self(self.0 % rhs.0); + } +} + +impl std::ops::RemAssign for Cycles { + fn rem_assign(&mut self, rhs: u32) { + *self = Self(self.0 % rhs); + } +} + impl From for Cycles { fn from(num: u32) -> Self { Self(num) } } +impl From for u32 { + fn from(cycles: Cycles) -> Self { + cycles.0 + } +} + #[cfg(test)] mod tests { use super::Cycles;