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.
This commit is contained in:
Tobin C. Harding 2025-02-07 07:22:00 +11:00
parent 5ce8781162
commit a0211906fe
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 3 additions and 8 deletions

View File

@ -57,7 +57,9 @@ where
}
/// Produces a hash from the current state of a given engine.
pub fn from_engine(e: HashEngine) -> Hash<T> { from_engine(e) }
pub fn from_engine(e: HashEngine) -> Hash<T> {
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<T: Tag> core::hash::Hash for Hash<T> {
crate::internal_macros::hash_trait_impls!(256, false, T: Tag);
fn from_engine<T>(e: sha256::HashEngine) -> Hash<T>
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]