diff --git a/src/main.rs b/src/main.rs index a691062..b9c862e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -145,13 +145,13 @@ impl State { } #[must_use] fn pick_and_load_image(&mut self) -> Task { - let task; - (self.error, task) = match utils::pick_image() { - Ok(path) => (None, self.load_image(path)), - Err(e) => (Some(e), Task::none()), - }; - - task + match utils::pick_image() { + Ok(path) => self.load_image(path), + Err(e) => { + self.error = Some(e); + Task::none() + } + } } fn save_image(&mut self) {