feat: derive ord and partialord for blake3digest

This commit is contained in:
tohrnii 2023-08-11 20:09:34 +00:00
parent d9e85230a6
commit fb649df1e7

View file

@ -26,7 +26,7 @@ const DIGEST20_BYTES: usize = 20;
///
/// Note: `N` can't be greater than `32` because [`Digest::as_bytes`] currently supports only 32
/// bytes.
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
#[cfg_attr(feature = "serde", serde(into = "String", try_from = "&str"))]
pub struct Blake3Digest<const N: usize>([u8; N]);