From ae8fad30cd9e76bcba9949095a2cafabb4f1ca8a Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sat, 8 Jul 2023 13:29:37 +0200 Subject: add merge functionality --- src/gui/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/mod.rs b/src/gui/mod.rs index a32ceff..5677db1 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -81,7 +81,7 @@ async fn load_file() -> Index { let file = file.unwrap(); let file = file.to_str(); let file = file.unwrap(); - Index::from_file(file) + Index::from_file(file.to_string()) } async fn generate() -> Index { @@ -100,11 +100,13 @@ async fn generate() -> Index { let input = input.unwrap(); let input = input.to_str(); let input = input.unwrap(); - Index::generate(input, file, |counter, nof| { + let index = Index::generate(input, |counter, nof| { let p = ((counter * 100) / nof) as u8; *GENERATE_PROGRESS.lock().unwrap() = p; std::io::stdout().flush().ok(); - }) + }); + index.save(file.to_string()); + index } async fn generate_update_timer() -> u8 { -- cgit v1.2.3-70-g09d2