Skip to content

Commit b22b1ab

Browse files
committed
Merge rust-bitcoin#5347: docs(hashes): replace deprecated GeneralHash references
31a07f1 docs(hashes): replace deprecated GeneralHash references (Bashmunta) Pull request description: The GeneralHash trait was removed (hashes/CHANGELOG.md rust-bitcoin#4085), but internal_macros.rs still referenced it in docs. Updated hash_trait_impls! and general_hash_type! documentation to reflect actual current requirements ACKs for top commit: apoelstra: ACK 31a07f1; successfully ran local tests tcharding: ACK 31a07f1 Tree-SHA512: 8d407a05767f0209f447d0f3923aeb4f5528c144c6a234b35721412d9e50ba8b24a950ff09fadaf6603ce63c75ed14c1b85480caf516db08b879c4e6378c8cbf
2 parents f241979 + 31a07f1 commit b22b1ab

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

hashes/src/internal_macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
///
1616
/// Restrictions on usage:
1717
///
18-
/// * The hash type must implement the `GeneralHash` trait.
18+
/// * The `Hash` type in scope must provide `from_byte_array`, `to_byte_array`, and `as_byte_array` (e.g., via `hash_type_no_default!`).
1919
macro_rules! hash_trait_impls {
2020
($bits:expr, $reverse:expr $(, $gen:ident: $gent:ident)*) => {
2121
$crate::impl_bytelike_traits!(Hash, { $bits / 8 } $(, $gen: $gent)*);
@@ -55,7 +55,7 @@ pub(crate) use hash_trait_impls;
5555
///
5656
/// Restrictions on usage:
5757
///
58-
/// * The hash type must implement the `GeneralHash` trait.
58+
/// * Requires a `HashEngine` type in this module implementing `Default` and `crate::HashEngine<Hash = Hash, Bytes = [u8; $bits / 8]>`.
5959
macro_rules! general_hash_type {
6060
($bits:expr, $reverse:expr, $doc:literal) => {
6161
/// Hashes some bytes.

hashes/tests/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fn api_all_non_error_types_have_non_empty_debug() {
201201
let t = Hashes::<Sha256>::new_sha256();
202202
check_debug!(t; a, c, d, e, f, g, h, i, j, k, l);
203203

204-
// This tests `Debug` on `Hkdf` but not for all `T: GeneralHash`.
204+
// This tests `Debug` on `Hkdf` but not for all `HashEngine` types.
205205
let t = Hkdf::<sha256::HashEngine>::new(&[], &[]);
206206
let debug = format!("{:?}", t);
207207
assert!(!debug.is_empty());

0 commit comments

Comments
 (0)