From 66ea301fc25a07485286560c434a9fdaf460c431 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 1 Nov 2020 16:10:00 +0000 Subject: Untangle caching code --- dhall/src/syntax/ast/expr.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'dhall/src/syntax/ast/expr.rs') 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, Error> { - use sha2::Digest; + pub fn sha256_hash(&self) -> Result, Error> { let data = binary::encode(self)?; - Ok(sha2::Sha256::digest(&data).as_slice().into()) + Ok(crate::utils::sha256_hash(&data)) } } -- cgit v1.2.3