From 6d9efb7eb85af929f3d6c22111933bb58d1ea07e Mon Sep 17 00:00:00 2001 From: taitep Date: Wed, 24 Dec 2025 16:14:54 +0100 Subject: [PATCH] Small refactor in exception handling in core.rs --- src/core.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/core.rs b/src/core.rs index 7e477c1..d5b254d 100644 --- a/src/core.rs +++ b/src/core.rs @@ -50,19 +50,17 @@ impl Core { } if instr & 3 != 3 { + // Compressed instruction - (currently) unsupported self.throw_exception(ExceptionType::IllegalInstruction); break; } let instr = Instruction(instr); - match find_and_exec(instr, self) { - Ok(()) => {} - Err(e) => { - self.throw_exception(e); - eprintln!("instr: {:08x}", instr.0); - break; - } + if let Err(e) = find_and_exec(instr, self) { + self.throw_exception(e); + eprintln!("instr: {:08x}", instr.0); + break; } } }