summaryrefslogtreecommitdiff
path: root/dhall/src/syntax/ast/expr.rs
diff options
context:
space:
mode:
authorNadrieril2020-11-01 16:10:00 +0000
committerNadrieril2020-11-01 17:36:49 +0000
commit66ea301fc25a07485286560c434a9fdaf460c431 (patch)
treea0bc78be155be39e3da0ad5f61d7255057f8747a /dhall/src/syntax/ast/expr.rs
parent2c245e7f5ce4019381e0fa47a1e2caf6276106be (diff)
Untangle caching code
Diffstat (limited to 'dhall/src/syntax/ast/expr.rs')
-rw-r--r--dhall/src/syntax/ast/expr.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/dhall/src/syntax/ast/expr.rs b/dhall/src/syntax/ast/expr.rs
index b1a978f..eba2735 100644
--- a/dhall/src/syntax/ast/expr.rs
+++ b/dhall/src/syntax/ast/expr.rs
@@ -178,10 +178,9 @@ impl Expr {
}
// Compute the sha256 hash of the binary form of the expression.
- pub fn hash(&self) -> Result<Box<[u8]>, Error> {
- use sha2::Digest;
+ pub fn sha256_hash(&self) -> Result<Box<[u8]>, Error> {
let data = binary::encode(self)?;
- Ok(sha2::Sha256::digest(&data).as_slice().into())
+ Ok(crate::utils::sha256_hash(&data))
}
}