diff --git a/parsing/src/parsing.rs b/parsing/src/parsing.rs index b2e6bb7..768aaae 100644 --- a/parsing/src/parsing.rs +++ b/parsing/src/parsing.rs @@ -10,6 +10,8 @@ impl FlatExWrapper { const fn new(f: FlatEx) -> Self { Self { func: Some(f) } } + const fn is_none(&self) -> bool { self.func.is_none() } + fn eval(&self, x: &[f64]) -> f64 { self.func .as_ref() @@ -71,6 +73,8 @@ impl BackingFunction { nth_derivative: None, }; + pub fn is_none(&self) -> bool { self.function.is_none() } + /// Create new [`BackingFunction`] instance pub fn new(func_str: &str) -> Result { if func_str.is_empty() { diff --git a/src/function_entry.rs b/src/function_entry.rs index 2c8173c..e78b217 100644 --- a/src/function_entry.rs +++ b/src/function_entry.rs @@ -383,7 +383,7 @@ impl FunctionEntry { pub fn display( &self, plot_ui: &mut PlotUi, settings: &AppSettings, main_plot_color: Color32, ) -> Option { - if self.test_result.is_some() { + if self.test_result.is_some() | self.function.is_none() { return None; }