diff options
author | iximeow <me@iximeow.net> | 2023-12-23 15:41:09 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2023-12-23 15:41:18 -0800 |
commit | 6668e8f87a3d2cf814c1ddd77a0eb6fec668c3eb (patch) | |
tree | 1f3e0c132196e6ab04a05c19ccc2742f902b14d4 /src/lib.rs | |
parent | 92260064e2073a6b3e18c0d2c042002740711c7b (diff) |
more fuzz targets
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -22,6 +22,25 @@ pub struct Instruction { length: u8, } +impl PartialEq for Instruction { + fn eq(&self, other: &Self) -> bool { + let Instruction { + opcode: left_opcode, + operands: _, // we won't use this `operands`, but `.operands()` to not use stale extra operands + length: left_length, + } = self; + let Instruction { + opcode: right_opcode, + operands: _, // we won't use this `operands`, but `.operands()` to not use stale extra operands + length: right_length, + } = other; + + left_opcode == right_opcode && + left_length == right_length && + self.operands() == other.operands() + } +} + impl Instruction { pub fn opcode(&self) -> Opcode { self.opcode |