From 07858b229f6787a616176dfca13b8afcce0bd86e Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Fri, 5 Dec 2025 20:21:37 -0500 Subject: [PATCH] parsing: remove unused code from FlatExWrapper --- parsing/src/parsing.rs | 41 ++--------------------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/parsing/src/parsing.rs b/parsing/src/parsing.rs index 4aa8c7d..04f1dec 100644 --- a/parsing/src/parsing.rs +++ b/parsing/src/parsing.rs @@ -4,21 +4,14 @@ use std::collections::HashMap; #[derive(Clone, PartialEq)] pub struct FlatExWrapper { func: Option>, - func_str: Option, } impl FlatExWrapper { - const EMPTY: FlatExWrapper = FlatExWrapper { - func: None, - func_str: None, - }; + const EMPTY: FlatExWrapper = FlatExWrapper { func: None }; #[inline] const fn new(f: FlatEx) -> Self { - Self { - func: Some(f), - func_str: None, - } + Self { func: Some(f) } } #[inline] @@ -34,26 +27,6 @@ impl FlatExWrapper { .unwrap_or(f64::NAN) } - #[inline] - fn partial(&self, x: usize) -> Self { - self.func - .as_ref() - .map(|f| f.clone().partial(x).map(Self::new).unwrap_or(Self::EMPTY)) - .unwrap_or(Self::EMPTY) - } - - #[inline] - fn get_string(&mut self) -> String { - match self.func_str { - Some(ref func_str) => func_str.clone(), - None => { - let calculated = self.func.as_ref().map(|f| f.unparse()).unwrap_or(""); - self.func_str = Some(calculated.to_owned()); - calculated.to_owned() - } - } - } - #[inline] fn partial_iter(&self, n: usize) -> Self { self.func @@ -165,17 +138,7 @@ impl BackingFunction { } } -fn prettyify_function_str(func: &str) -> String { - let new_str = func.replace("{x}", "x"); - if &new_str == "0/0" { - "Undefined".to_owned() - } else { - new_str - } -} - -// pub const VALID_VARIABLES: [char; 3] = ['x', 'e', 'π']; /// Case insensitive checks for if `c` is a character used to represent a variable #[inline]