cleanup + properly handle saving function data

This commit is contained in:
Simon Gardling
2022-05-25 12:24:25 -04:00
parent 24526d138d
commit 123c49a5d8
4 changed files with 56 additions and 34 deletions

View File

@@ -11,6 +11,7 @@ use parsing::{process_func_str, BackingFunction};
use serde::{ser::SerializeStruct, Deserialize, Deserializer, Serialize, Serializer};
use std::{
fmt::{self, Debug},
hash::{Hash, Hasher},
intrinsics::assume,
};
@@ -62,6 +63,16 @@ pub struct FunctionEntry {
pub settings_opened: bool,
}
impl Hash for FunctionEntry {
fn hash<H: Hasher>(&self, state: &mut H) {
self.raw_func_str.hash(state);
self.integral.hash(state);
self.nth_derviative.hash(state);
self.curr_nth.hash(state);
self.settings_opened.hash(state);
}
}
impl Serialize for FunctionEntry {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where