diff --git a/lib/src/content_hash.rs b/lib/src/content_hash.rs index 4738697680..7e49ddaa82 100644 --- a/lib/src/content_hash.rs +++ b/lib/src/content_hash.rs @@ -79,6 +79,15 @@ impl ContentHash for [T] { } } +impl ContentHash for [T; N] { + fn hash(&self, state: &mut impl DigestUpdate) { + state.update(&(N as u64).to_le_bytes()); + for x in self { + x.hash(state); + } + } +} + impl ContentHash for Vec { fn hash(&self, state: &mut impl DigestUpdate) { self.as_slice().hash(state)