From 3b7c42ceec6a4906cd0002477c09cfc431ed8cb0 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Fri, 11 Dec 2015 10:54:29 +0100 Subject: [PATCH] Working with opcode in separate function --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index ab2d112..cf379a2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use std::io::{self, Read}; -fn opcode(input: &Vec, counter: &usize) -> usize { +fn opcode(input: &Vec, counter: usize) -> usize { let size: usize; let opcode = input[counter]; @@ -50,7 +50,7 @@ fn main() { while counter < input.len() { // get the instruction - oplength = opcode(&input, &counter); + oplength = opcode(&input, counter); counter += oplength; } }