GrantM11235[m]: > <@grantm11235:matrix.org> If you replace CommandConstruct with this, you can lazily calculate the values when needed, so you don't need to do redundant work > ```rust > #[derive(Clone, Copy, Debug)] > struct RawCommand(u16); > > impl RawCommand { > fn reg_x(self) -> Reg { > let nibble = (self.0 >> 8) &0x000F > Reg::from_nibble(nibble) > } > fn reg_y(self) -> Reg { > let nibble = (self.0 >> 4) &0x000F > Reg::from_nibble(nibble) > } > fn val4(self) -> u8 { > self.0 & 0x000F as u8 > } > fn val8(self) -> u8 { > self.0 & 0x00FF as u8 > } > fn val12(self) -> u16 { > self.0 & 0x0FFF > } > } > ``` Wow, I love this. `Reg::from_nibble(nibble)`