Skip to content

Commit

Permalink
syn: Add missing new_from_array method to Hash
Browse files Browse the repository at this point in the history
That method was being called, but not actually defined. Reproducable
only for `bpf` target.

Fixes: #2681
  • Loading branch information
vadorovsky committed Oct 24, 2023
1 parent e0d0df4 commit 0f80594
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lang/syn/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ impl Hash {
Hash(<[u8; HASH_BYTES]>::try_from(hash_slice).unwrap())
}

pub const fn new_from_array(hash_array: [u8; HASH_BYTES]) -> Self {
Self(hash_array)
}

pub fn to_bytes(self) -> [u8; HASH_BYTES] {
self.0
}
Expand Down

0 comments on commit 0f80594

Please sign in to comment.