Replace unwrap with ? in hash generation (#3003)

And add tests to catch it.
This commit is contained in:
Charlie Marsh 2024-04-11 20:41:08 -04:00 committed by GitHub
parent 8507ba872f
commit 3df8df656b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 68 additions and 3 deletions

View file

@ -340,7 +340,7 @@ pub enum HashError {
InvalidStructure(String),
#[error(
"Unsupported hash algorithm (expected `md5`, `sha256`, `sha384`, or `sha512`) on: {0}"
"Unsupported hash algorithm: `{0}` (expected one of: `md5`, `sha256`, `sha384`, or `sha512`)"
)]
UnsupportedHashAlgorithm(String),
}