Skip to content

Commit

Permalink
Use precision when formatting core::hash::Hasher
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tcharding committed Aug 22, 2024
1 parent 15b3452 commit af997d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit af997d8

Please sign in to comment.