From bf01898c6f3f8212d58b3e2020de11cb60903573 Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Thu, 22 Jan 2026 09:22:47 +0100 Subject: [PATCH] remove extra function --- src/ui/storage.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ui/storage.rs b/src/ui/storage.rs index f91a1cb..5b0b06b 100644 --- a/src/ui/storage.rs +++ b/src/ui/storage.rs @@ -354,11 +354,6 @@ pub fn compress_file(data: &[(&[u8], &str)]) -> Vec { compressed_file } -fn write_rom_save(ui: &ui::Ui) { - let data = postcard::to_stdvec(&ui.storage.saves.romsave.data).unwrap(); - std::fs::write(ui.storage.paths.romsave_file_path.clone(), data).unwrap(); -} - fn writeback_sdcard(device: &mut device::Device) { let length; let save_data: &[u8]; @@ -422,6 +417,7 @@ pub fn write_saves(device: &mut device::Device) { fn write_save(ui: &ui::Ui, save_type: SaveTypes) { let path: &std::path::Path; let data: &Vec; + let rom_save_data: Vec; match save_type { SaveTypes::Eeprom4k | SaveTypes::Eeprom16k => { path = ui.storage.paths.eep_file_path.as_ref(); @@ -444,8 +440,9 @@ fn write_save(ui: &ui::Ui, save_type: SaveTypes) { data = ui.storage.saves.sdcard.data.as_ref(); } SaveTypes::Romsave => { - write_rom_save(ui); - return; + path = ui.storage.paths.romsave_file_path.as_ref(); + rom_save_data = postcard::to_stdvec(&ui.storage.saves.romsave.data).unwrap(); + data = rom_save_data.as_ref(); } } let result = std::fs::write(path, data);