From af997d81ca94bab84f232f14ef75dbb3e43bc527 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 23 Aug 2024 09:10:25 +1000 Subject: [PATCH] Use precision when formatting core::hash::Hasher It seems the `core::hash::Hasher` supports precision as well as width formatting but defaults to displaying as an integer. To be uniform with our usage of `hashes::sha256::Hash` type (and unsurprising to the reader) use the precision formatting parameter. Note this does not change the output, the unit test is not touched. --- src/secret.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/secret.rs b/src/secret.rs index 49323dd27..9fd43be30 100644 --- a/src/secret.rs +++ b/src/secret.rs @@ -28,7 +28,7 @@ macro_rules! impl_display_secret { hasher.write(&self.secret_bytes()); let hash = hasher.finish(); - f.debug_tuple(stringify!($thing)).field(&format_args!("#{:016x}", hash)).finish() + f.debug_tuple(stringify!($thing)).field(&format_args!("#{:.16x}", hash)).finish() } }