From cae159bcceeefa5f01055b819068edba50d245ef Mon Sep 17 00:00:00 2001 From: danielwerg <35052399+danielwerg@users.noreply.github.com> Date: Sun, 28 Jul 2024 18:26:15 +0300 Subject: [PATCH] style: lint --- src/configuration.rs | 2 +- src/sketch_board.rs | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/configuration.rs b/src/configuration.rs index 935fc15..eabb533 100644 --- a/src/configuration.rs +++ b/src/configuration.rs @@ -351,7 +351,7 @@ struct ConfiguationFileGeneral { save_after_copy: Option, default_hide_toolbars: Option, primary_highlighter: Option, - disable_notifications: Option + disable_notifications: Option, } #[derive(Deserialize)] diff --git a/src/sketch_board.rs b/src/sketch_board.rs index 9f3a070..d68996a 100644 --- a/src/sketch_board.rs +++ b/src/sketch_board.rs @@ -191,7 +191,10 @@ impl SketchBoard { // TODO: we could support more data types if !output_filename.ends_with(".png") { - log_result("The only supported format is png, but the filename does not end in png", !APP_CONFIG.read().disable_notifications()); + log_result( + "The only supported format is png, but the filename does not end in png", + !APP_CONFIG.read().disable_notifications(), + ); return; } @@ -204,8 +207,14 @@ impl SketchBoard { }; match fs::write(&output_filename, data) { - Err(e) => log_result(&format!("Error while saving file: {e}"), !APP_CONFIG.read().disable_notifications()), - Ok(_) => log_result(&format!("File saved to '{}'.", &output_filename), !APP_CONFIG.read().disable_notifications()), + Err(e) => log_result( + &format!("Error while saving file: {e}"), + !APP_CONFIG.read().disable_notifications(), + ), + Ok(_) => log_result( + &format!("File saved to '{}'.", &output_filename), + !APP_CONFIG.read().disable_notifications(), + ), }; } @@ -250,7 +259,10 @@ impl SketchBoard { match result { Err(e) => println!("Error saving {e}"), Ok(()) => { - log_result("Copied to clipboard.", !APP_CONFIG.read().disable_notifications()); + log_result( + "Copied to clipboard.", + !APP_CONFIG.read().disable_notifications(), + ); // TODO: rethink order and messaging patterns if APP_CONFIG.read().save_after_copy() {