Split Payload and PayloadType

This commit is contained in:
Werner
2021-12-26 18:44:17 -03:00
parent 96abcde56b
commit 5b7fc61723
5 changed files with 23 additions and 15 deletions

View File

@ -1,6 +1,5 @@
use crate::Machine;
use crate::Payload::PayloadType;
use crate::Types::Byte;
use crate::{Machine, PayloadType};
pub struct Instruction {
pub code: Byte,
@ -13,7 +12,12 @@ pub type InstructionFunction = fn(machine: &mut Machine) -> bool;
impl Instruction {
#[inline]
pub fn New(code: Byte, name: &str, payload: PayloadType, function: InstructionFunction) -> Self {
pub fn New(
code: Byte,
name: &str,
payload: PayloadType,
function: InstructionFunction,
) -> Self {
Self {
code,
name: name.to_string(),