fix: use finalize for digest comparison in eq

This commit is contained in:
Andrew Phillips (aider)
2025-05-12 19:40:12 -03:00
parent 64aaf5d4d5
commit 1aba71a3d6

View File

@@ -13,7 +13,9 @@ impl DigestEngineSha256 {
// Manual implementation of PartialEq // Manual implementation of PartialEq
fn eq(&self, other: &Self) -> bool { fn eq(&self, other: &Self) -> bool {
self.hasher.clone().result().as_slice() == other.hasher.clone().result().as_slice() let result1 = self.hasher.clone().finalize();
let result2 = other.hasher.clone().finalize();
result1.as_slice() == result2.as_slice()
} }
// Manual implementation of Eq // Manual implementation of Eq