From 8e0ab8a90137c565ab727eaa37ef3a6d9564f13c Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 18 Jan 2020 14:33:11 -0800 Subject: get pic18 towards using no_std, switch to yaxpeax-arch crate --- src/lib.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index c29f190..506a0e5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,8 +84,8 @@ impl yaxpeax_arch::Instruction for Instruction { fn well_defined(&self) -> bool { true } } -impl Instruction { - pub fn blank() -> Instruction { +impl Default for Instruction { + fn default() -> Instruction { Instruction { opcode: Opcode::NOP, operands: [Operand::Nothing, Operand::Nothing] @@ -196,10 +196,6 @@ pub struct InstDecoder {} impl Decoder for InstDecoder { type Error = DecodeError; - fn decode>(&self, bytes: T) -> Result { - let mut blank = Instruction::blank(); - self.decode_into(&mut blank, bytes).map(|_: ()| blank) - } fn decode_into>(&self, inst: &mut Instruction, bytes: T) -> Result<(), Self::Error> { let mut bytes_iter = bytes.into_iter(); let word: Vec = bytes_iter.by_ref().take(2).collect(); -- cgit v1.1