From f631c1deb9f9998a2fd52e3d158e5740c45e6085 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Thu, 29 Aug 2024 23:30:14 +0200 Subject: [PATCH] refactor: use digest method in hash util --- src/util.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util.rs b/src/util.rs index 9e62d20..d6bdd39 100644 --- a/src/util.rs +++ b/src/util.rs @@ -74,7 +74,5 @@ pub fn deserialize_git_like_url<'de, D: Deserializer<'de>>( } pub fn hash>(struc: S) -> String { - let mut hasher = Sha256::new(); - hasher.update(struc.as_ref()); - format!("{:x}", hasher.finalize()) + format!("{:x}", Sha256::digest(struc.as_ref())) }