From b821b04bf383f2955b66fb4b65a3d8a8893b697c Mon Sep 17 00:00:00 2001 From: Piyush Mishra Date: Sun, 16 Jan 2022 17:30:35 +0530 Subject: [PATCH] Path --- src/utils.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index 1a4a45c..55efde4 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -168,7 +168,9 @@ impl ImageContainer { .unwrap(), ); - if fs::write(&path_conf, serde_json::to_string(&*prop).unwrap()).is_err() { + let mut prop = prop.clone(); + prop.path = None; + if fs::write(&path_conf, serde_json::to_string(&prop).unwrap()).is_err() { dialog::message_default("Failed to save conf!"); } @@ -265,7 +267,7 @@ impl ImageContainer { } } -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub(crate) struct ImageProperties { pub(crate) path: Option, pub(crate) dimension: (f64, f64),