fix instruction.rs
This commit is contained in:
parent
fba4c9e5e7
commit
d8e221e05a
1 changed files with 3 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
use std::fmt::{Display, Formatter, Write};
|
use std::fmt;
|
||||||
|
use std::fmt::{Display, Formatter, LowerHex};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Instruction {
|
pub struct Instruction {
|
||||||
|
@ -9,7 +10,7 @@ impl Instruction {
|
||||||
/// Creates a new instruction instance.
|
/// Creates a new instruction instance.
|
||||||
pub(crate) fn new(data: [u8; 2]) -> Self {
|
pub(crate) fn new(data: [u8; 2]) -> Self {
|
||||||
Instruction {
|
Instruction {
|
||||||
data: (data[1] as u16) << 8u8 | (data[0] as u16),
|
data: (data[0] as u16) << 8u8 | (data[1] as u16),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue