From 0f80594ac4d6142dad98468081345e15ce4e199f Mon Sep 17 00:00:00 2001 From: Mike Rostecki Date: Tue, 24 Oct 2023 22:59:03 +0200 Subject: [PATCH] syn: Add missing `new_from_array` method to `Hash` That method was being called, but not actually defined. Reproducable only for `bpf` target. Fixes: #2681 --- lang/syn/src/hash.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lang/syn/src/hash.rs b/lang/syn/src/hash.rs index 8a826aa1dc..9009cd48bc 100644 --- a/lang/syn/src/hash.rs +++ b/lang/syn/src/hash.rs @@ -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 }