From be37a4ed4059ce79321c5e3f2438934866ec7be5 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Fri, 19 Jan 2024 20:14:57 +0100 Subject: add function_cache for performence gain --- src/math/expression.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/math/expression.rs') 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, -- cgit v1.2.3-70-g09d2