summaryrefslogtreecommitdiff
path: root/src/eval/class.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval/class.rs')
-rw-r--r--src/eval/class.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/eval/class.rs b/src/eval/class.rs
index acdf38e6..c4880e9a 100644
--- a/src/eval/class.rs
+++ b/src/eval/class.rs
@@ -1,4 +1,5 @@
use std::fmt::{self, Debug, Formatter, Write};
+use std::hash::{Hash, Hasher};
use super::{Args, EvalContext, Func, StyleMap, Template, Value};
use crate::diag::TypResult;
@@ -103,6 +104,13 @@ impl PartialEq for Class {
}
}
+impl Hash for Class {
+ fn hash<H: Hasher>(&self, state: &mut H) {
+ (self.construct as usize).hash(state);
+ (self.set as usize).hash(state);
+ }
+}
+
/// Construct an instance of a class.
pub trait Construct {
/// Construct an instance of this class from the arguments.