code improvements

This commit is contained in:
Simon Gardling
2022-05-12 10:57:10 -04:00
parent 91855d14fc
commit 020064a79e
14 changed files with 221 additions and 165 deletions

View File

@@ -1,6 +1,6 @@
use exmex::prelude::*;
#[derive(Clone)]
#[derive(Clone, PartialEq)]
pub(crate) struct FlatExWrapper {
func: Option<FlatEx<f64>>,
}
@@ -45,7 +45,7 @@ impl const Default for FlatExWrapper {
}
/// Function that includes f(x), f'(x), f'(x)'s string representation, and f''(x)
#[derive(Clone)]
#[derive(Clone, PartialEq)]
pub struct BackingFunction {
/// f(x)
function: FlatExWrapper,
@@ -73,7 +73,7 @@ impl BackingFunction {
nth_derivative: None,
};
pub fn is_none(&self) -> bool { self.function.is_none() }
pub const fn is_none(&self) -> bool { self.function.is_none() }
/// Create new [`BackingFunction`] instance
pub fn new(func_str: &str) -> Result<Self, String> {