From d8e221e05ae32b64d86e2eb5bdfbd8acf1be9356 Mon Sep 17 00:00:00 2001 From: Denis-Cosmin NUTIU Date: Sun, 1 Dec 2024 23:10:39 +0200 Subject: [PATCH] fix instruction.rs --- src/instruction.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/instruction.rs b/src/instruction.rs index ab5bb0d..9a5f0c6 100644 --- a/src/instruction.rs +++ b/src/instruction.rs @@ -1,4 +1,5 @@ -use std::fmt::{Display, Formatter, Write}; +use std::fmt; +use std::fmt::{Display, Formatter, LowerHex}; #[derive(Debug)] pub struct Instruction { @@ -9,7 +10,7 @@ impl Instruction { /// Creates a new instruction instance. pub(crate) fn new(data: [u8; 2]) -> Self { Instruction { - data: (data[1] as u16) << 8u8 | (data[0] as u16), + data: (data[0] as u16) << 8u8 | (data[1] as u16), } } }