From cdfa7bdaf2b8aa7d30656b3a58bec3d73737d047 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 21 Jul 2022 11:48:24 +0200 Subject: Remove call to AsRef::as_ref() The `sha1::Sha1::digest()` function takes an `AsRef` as argument, which the object in `b64_bytes` implements, so the call is no longer necessary. Signed-off-by: Matthias Beyer --- crates/common/certificate/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/common/certificate/src/lib.rs b/crates/common/certificate/src/lib.rs index 00bdefed..f7ce03f5 100644 --- a/crates/common/certificate/src/lib.rs +++ b/crates/common/certificate/src/lib.rs @@ -312,7 +312,7 @@ mod tests { // just decode the key contents let b64_bytes = base64::decode(&cert_cont[header_len..cert_cont.len() - footer_len]).unwrap(); - let expected_thumbprint = format!("{:x}", sha1::Sha1::digest(b64_bytes.as_ref())); + let expected_thumbprint = format!("{:x}", sha1::Sha1::digest(b64_bytes)); // compare the two thumbprints assert_eq!(thumbprint, expected_thumbprint.to_uppercase()); -- cgit v1.2.3