From a0211906fe265eb848823c8fdbd407a3ea372770 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 7 Feb 2025 07:22:00 +1100 Subject: [PATCH] sha256t: Remove standalone from_engine function This function is meant to be used in conjunction with the `general_hash_type` macro but the `sha256t` module does not use that macro. Inline the function. Internal change only. --- hashes/src/sha256t/mod.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hashes/src/sha256t/mod.rs b/hashes/src/sha256t/mod.rs index cb91f6ab0..f355ac82e 100644 --- a/hashes/src/sha256t/mod.rs +++ b/hashes/src/sha256t/mod.rs @@ -57,7 +57,9 @@ where } /// Produces a hash from the current state of a given engine. - pub fn from_engine(e: HashEngine) -> Hash { from_engine(e) } + pub fn from_engine(e: HashEngine) -> Hash { + Hash::from_byte_array(sha256::Hash::from_engine(e).to_byte_array()) + } /// Constructs a new engine. pub fn engine() -> HashEngine { @@ -135,13 +137,6 @@ impl core::hash::Hash for Hash { crate::internal_macros::hash_trait_impls!(256, false, T: Tag); -fn from_engine(e: sha256::HashEngine) -> Hash -where - T: Tag, -{ - Hash::from_byte_array(sha256::Hash::from_engine(e).to_byte_array()) -} - // Workaround macros being unavailable in attributes. #[doc(hidden)] #[macro_export]