summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 1ef6f13..2da8e1f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -14,20 +14,23 @@ pub struct Instruction {
impl LengthedInstruction for Instruction {
type Unit = <PIC24 as Arch>::Address;
+ fn min_size() -> Self::Unit {
+ 3
+ }
fn len(&self) -> Self::Unit {
3 // ish
}
}
impl Decodable for Instruction {
- fn decode<'a, T: IntoIterator<Item=&'a u8>>(bytes: T) -> Option<Self> {
+ fn decode<T: IntoIterator<Item=u8>>(bytes: T) -> Option<Self> {
let mut blank = Instruction { opcode: Opcode::NOP };
match blank.decode_into(bytes) {
Some(_) => Some(blank),
None => None
}
}
- fn decode_into<'a, T: IntoIterator<Item=&'a u8>>(&mut self, bytes: T) -> Option<()> {
+ fn decode_into<T: IntoIterator<Item=u8>>(&mut self, bytes: T) -> Option<()> {
match bytes.into_iter().next() {
Some(0x00) => {
self.opcode = Opcode::NOP;