aboutsummaryrefslogtreecommitdiff
path: root/src/math/expression.rs
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-01-19 20:14:57 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2024-01-19 20:14:57 +0100
commitbe37a4ed4059ce79321c5e3f2438934866ec7be5 (patch)
tree9ab9ece4b21bd805e614743420896dafe9f794dd /src/math/expression.rs
parent1c5233b185e52d42c7878ac8b6cf046a5bb54a09 (diff)
add function_cache for performence gain
Diffstat (limited to 'src/math/expression.rs')
-rw-r--r--src/math/expression.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/math/expression.rs b/src/math/expression.rs
index 049886d..14a3eb8 100644
--- a/src/math/expression.rs
+++ b/src/math/expression.rs
@@ -4,6 +4,7 @@ use super::function::FunctionArgument;
use super::string::{ContainsAndSkipBrackets, SplitMatchingBracket};
use super::operation::Operation;
+#[derive(PartialEq, Eq, Hash, Clone)]
enum ExpressionType {
Value(Complex),
Variable(String),
@@ -17,7 +18,7 @@ impl Default for ExpressionType {
}
}
-#[derive(Default)]
+#[derive(Default, PartialEq, Eq, Hash, Clone)]
pub struct Expression {
expr_type: ExpressionType,
repr: String,