diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -219,7 +219,12 @@ fn counter_high(counter: u64) -> u32 { #[cfg_attr(feature = "zeroize", derive(zeroize::Zeroize))] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[derive(Clone, Copy, Hash)] -pub struct Hash([u8; OUT_LEN]); +pub struct Hash( + #[rustfmt::skip] + // In formats like CBOR, bytestrings are more compact than lists of ints. + #[cfg_attr(feature = "serde", serde(with = "serde_bytes"))] + [u8; OUT_LEN], +); impl Hash { /// The raw bytes of the `Hash`. Note that byte arrays don't provide |
