summaryrefslogtreecommitdiff
path: root/src/layout/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-05-29 15:45:57 +0200
committerLaurenz <laurmaedje@gmail.com>2021-05-31 22:33:40 +0200
commite023bf2ac9f5796355d9485afc16781196bf212b (patch)
tree26d4487de0c4e2d0f69182483301de867cb5fa34 /src/layout/mod.rs
parent9f77f09aacd1fb0fd6138a6d16ed2755f6bfae3f (diff)
Module loading system
Detects cyclic imports and loads each module only once per compilation.
Diffstat (limited to 'src/layout/mod.rs')
-rw-r--r--src/layout/mod.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index 30776fa2..9d5ccdc0 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -22,7 +22,6 @@ use std::fmt::{self, Debug, Formatter};
use std::hash::{Hash, Hasher};
use decorum::N64;
-use fxhash::FxHasher64;
use crate::cache::Cache;
use crate::geom::*;
@@ -81,12 +80,7 @@ impl AnyNode {
where
T: Layout + Debug + Clone + PartialEq + Hash + 'static,
{
- let hash = {
- let mut state = FxHasher64::default();
- node.hash(&mut state);
- state.finish()
- };
-
+ let hash = fxhash::hash64(&node);
Self { node: Box::new(node), hash }
}
}