diff options
author | Nadrieril | 2020-11-01 18:50:09 +0000 |
---|---|---|
committer | GitHub | 2020-11-01 18:50:09 +0000 |
commit | 2ae979a22ee4b79590f74110d61164383c7b5182 (patch) | |
tree | 5286606d6d59f5d5d4b9ecb7f651c97d201a092e /dhall/src/syntax/ast/expr.rs | |
parent | 48037367933085ca9c1c67c8c59f311e2b21be6d (diff) | |
parent | e5381c9b76f1d88dedb4a453cd026c8e98be5533 (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.rs | 5 |
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)) } } |