diff --git a/src/rom.rs b/src/rom.rs index b65bbd4..9a7f3fe 100644 --- a/src/rom.rs +++ b/src/rom.rs @@ -114,11 +114,11 @@ impl Card for Rom { println!("Read ROM image file {}", cmd[1]); } else if cmd[0] == "reload" { if let Some(file_name) = &self.file_name { - let mut file = File::open(cmd[1]) - .map_err(|e| anyhow!("Couldn't open ROM image file {} ({})", cmd[1], e))?; + let mut file = File::open(file_name) + .map_err(|e| anyhow!("Couldn't open ROM image file {} ({})", file_name, e))?; self.data.clear(); file.read_to_end(&mut self.data) - .map_err(|e| anyhow!("Failed to read ROM image file {} ({})", cmd[1], e))?; + .map_err(|e| anyhow!("Failed to read ROM image file {} ({})", file_name, e))?; println!("Reloaded ROM image file {}", file_name); } else { println!("No ROM image file to reload");