diff --git a/src/bin/randomprime_patcher.rs b/src/bin/randomprime_patcher.rs index 096b86db..a42e79d7 100644 --- a/src/bin/randomprime_patcher.rs +++ b/src/bin/randomprime_patcher.rs @@ -1,4 +1,4 @@ -use std::{panic, process::Command, time::Instant}; +use std::{panic, process::Command}; use clap::Format; use randomprime::{patch_config::PatchConfig, patches, reader_writer, structs}; @@ -78,10 +78,9 @@ fn maybe_pause_at_exit() { } fn main_inner() -> Result<(), String> { - let start_time = Instant::now(); let patch_config = PatchConfig::from_cli_options()?; let pn = ProgressNotifier::new(patch_config.quiet); - patches::patch_iso(patch_config, pn, start_time)?; + patches::patch_iso(patch_config, pn)?; println!("Done"); Ok(()) } diff --git a/src/c_interface.rs b/src/c_interface.rs index cf17d71a..34e4b137 100644 --- a/src/c_interface.rs +++ b/src/c_interface.rs @@ -4,7 +4,6 @@ use std::{ os::raw::c_char, panic, path::Path, - time::Instant, }; use serde::Serialize; @@ -101,8 +100,6 @@ fn inner( cb_data: *const (), cb: extern "C" fn(*const (), *const c_char), ) -> Result<(), String> { - let start_time = Instant::now(); - let config_json = unsafe { CStr::from_ptr(config_json) } .to_str() .map_err(|e| format!("JSON parse failed: {}", e))?; @@ -110,7 +107,7 @@ fn inner( let patch_config = PatchConfig::from_json(config_json)?; let pn = ProgressNotifier::new(cb_data, cb); - patches::patch_iso(patch_config, pn, start_time)?; + patches::patch_iso(patch_config, pn)?; Ok(()) } diff --git a/src/patches.rs b/src/patches.rs index 43fe934d..f8463f72 100644 --- a/src/patches.rs +++ b/src/patches.rs @@ -15382,10 +15382,11 @@ fn patch_arboretum_sandstone(patcher: &mut PrimePatcher<'_, '_>) { }); } -pub fn patch_iso(config: PatchConfig, mut pn: T, start_time: Instant) -> Result<(), String> +pub fn patch_iso(config: PatchConfig, mut pn: T) -> Result<(), String> where T: structs::ProgressNotifier, { + let start_time = Instant::now(); let mut audio_override_patches: Vec = Vec::new(); for (pak_name, rooms) in pickup_meta::ROOM_INFO.iter() { let world = World::from_pak(pak_name).unwrap();