From 6d645f565675a491ba3497a71e3721cf9aea8b11 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 18 Jan 2020 14:33:45 -0800 Subject: move pic24 to yaxpeax-arch crate --- src/lib.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 523a8df..b5f92f0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,6 +21,14 @@ pub struct Instruction { pub opcode: Opcode } +impl Default for Instruction { + fn default() -> Self { + Instruction { + opcode: Opcode::NOP + } + } +} + impl LengthedInstruction for Instruction { type Unit = ::Address; fn min_size() -> Self::Unit { @@ -65,10 +73,6 @@ pub struct InstDecoder {} impl Decoder for InstDecoder { type Error = DecodeError; - fn decode>(&self, bytes: T) -> Result { - let mut blank = Instruction { opcode: Opcode::NOP }; - self.decode_into(&mut blank, bytes).map(|_: ()| blank) - } fn decode_into>(&self, instr: &mut Instruction, bytes: T) -> Result<(), Self::Error> { match bytes.into_iter().next() { Some(0x00) => { -- cgit v1.1