Skip to content

Commit af997d8

Browse files
committed
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.
1 parent 15b3452 commit af997d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/secret.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ macro_rules! impl_display_secret {
2828
hasher.write(&self.secret_bytes());
2929
let hash = hasher.finish();
3030

31-
f.debug_tuple(stringify!($thing)).field(&format_args!("#{:016x}", hash)).finish()
31+
f.debug_tuple(stringify!($thing)).field(&format_args!("#{:.16x}", hash)).finish()
3232
}
3333
}
3434

0 commit comments

Comments
 (0)