Use Into in Hash::result() instead of TryFrom (#29721)

This commit is contained in:
Brooks 2023-01-16 12:13:04 -05:00 committed by GitHub
parent 8a28877910
commit da39c4837f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -61,9 +61,7 @@ impl Hasher {
}
}
pub fn result(self) -> Hash {
// At the time of this writing, the sha2 library is stuck on an old version
// of generic_array (0.9.0). Decouple ourselves with a clone to our version.
Hash(<[u8; HASH_BYTES]>::try_from(self.hasher.finalize().as_slice()).unwrap())
Hash(self.hasher.finalize().into())
}
}