From 973d774fbbee0232bdf09b8ac88077fd50b8c005 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 28 Feb 2022 13:44:08 -0500 Subject: [PATCH] improve Option handling --- src/egui_app.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/egui_app.rs b/src/egui_app.rs index 283b8bd..499f258 100644 --- a/src/egui_app.rs +++ b/src/egui_app.rs @@ -178,9 +178,8 @@ impl epi::App for MathApp { if !self.func_strs[i].is_empty() { let proc_func_str = add_asterisks(self.func_strs[i].clone()); let func_test_output = test_func(proc_func_str.clone()); - if func_test_output.is_some() { - parse_error += &format!("(Function #{}) ", i); - parse_error += &func_test_output.unwrap(); + if let Some(test_output_value) = func_test_output { + parse_error += &format!("(Function #{}) {}", i, test_output_value); } else { function.update(proc_func_str, integral, Some(self.integral_min_x), Some(self.integral_max_x), Some(self.integral_num)); }