Update A instruction parsing condition

This commit is contained in:
Hazem Krimi
2024-03-17 19:24:28 +01:00
parent d99316ad07
commit 3aa59ef230
+1 -1
View File
@@ -4,7 +4,7 @@ use regex::Regex;
pub fn parse(instruction: &String) -> Instruction { pub fn parse(instruction: &String) -> Instruction {
let mut cloned = instruction.clone(); let mut cloned = instruction.clone();
if cloned.chars().nth(0).unwrap() == '@' { if cloned.starts_with('@') {
cloned.remove(0); cloned.remove(0);
return Instruction::AInstruction(AInstruction { return Instruction::AInstruction(AInstruction {