Skip to content

Commit

Permalink
fix: impl DesyncHash for arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxCWhitehead committed Sep 15, 2024
1 parent 0826906 commit 8f1a31d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions framework_crates/bones_utils/src/desync_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ impl DesyncHash for bool {
}
}

impl<T: DesyncHash, const N: usize> DesyncHash for [T; N] {
fn hash(&self, hasher: &mut dyn std::hash::Hasher) {
for value in self {
DesyncHash::hash(value, hasher);
}
}
}

impl<T: DesyncHash> DesyncHash for Vec<T> {
fn hash(&self, hasher: &mut dyn std::hash::Hasher) {
for value in self {
Expand Down

0 comments on commit 8f1a31d

Please sign in to comment.