mirror of
https://github.com/guilhermewerner/machine
synced 2025-06-16 13:14:18 +00:00
Split Payload and PayloadType
This commit is contained in:
@ -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(),
|
||||
|
Reference in New Issue
Block a user