summaryrefslogtreecommitdiff
path: root/dhall/src/syntax/ast/expr.rs
diff options
context:
space:
mode:
authorNadrieril2020-11-01 18:50:09 +0000
committerGitHub2020-11-01 18:50:09 +0000
commit2ae979a22ee4b79590f74110d61164383c7b5182 (patch)
tree5286606d6d59f5d5d4b9ecb7f651c97d201a092e /dhall/src/syntax/ast/expr.rs
parent48037367933085ca9c1c67c8c59f311e2b21be6d (diff)
parente5381c9b76f1d88dedb4a453cd026c8e98be5533 (diff)
Merge pull request #192 from Nadrieril/rework-caching
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))
}
}