diff --git a/src/cpu.rs b/src/cpu.rs index fa102c2b70d2305edc200e7081d05a8500b6230a..4c93824425308b52046dff2df463e99c564ea9b0 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -280,7 +280,12 @@ impl Cpu { } #[cfg(feature = "cpulog")] - println!("[0x{:04x}] {}\t({} cycles)", self.pc - 1, inst_str, inst_time); + println!( + "[0x{:04x}] {}\t({} cycles)", + self.pc - 1, + inst_str, + inst_time + ); #[cfg(feature = "secure")] if self.mmu.boot_active() && self.pc - 1 > 0x08ff { diff --git a/src/util.rs b/src/util.rs index 177b9b67c13f8afea6982249de83727af77b14f1..96776eecc5b692c096fae2dabd603f119a988465 100644 --- a/src/util.rs +++ b/src/util.rs @@ -3,7 +3,10 @@ use std::{cell::RefCell, fs::File, io::Read, rc::Rc}; pub type SharedMut<T> = Rc<RefCell<T>>; pub fn read_file(path: &str) -> Vec<u8> { - let mut file = File::open(path).unwrap(); + let mut file = match File::open(path) { + Ok(file) => file, + Err(_) => panic!("Failed to open file: {}", path), + }; let mut data = Vec::new(); file.read_to_end(&mut data).unwrap(); data