Document the sha256t_hash_newtype direction
Since the default display direction is now forward, use `#[hash_newtype(backward)]` in the rustdocs on the macro. Also add an example usage to the changelog in case someone downstream is relying on the old default behaviour of displaying backwards (unlikely).
This commit is contained in:
parent
30e91cc766
commit
7685461e62
|
@ -1,3 +1,20 @@
|
||||||
|
# unreleased
|
||||||
|
|
||||||
|
* Change the default display direction of for tagged hashes to forwards. [#2707](https://github.com/rust-bitcoin/rust-bitcoin/pull/2707)
|
||||||
|
|
||||||
|
Note please this usage if you need to display backward:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
sha256t_hash_newtype! {
|
||||||
|
/// Test detailed explanation.
|
||||||
|
struct NewTypeTag = hash_str("tag");
|
||||||
|
|
||||||
|
/// A test hash.
|
||||||
|
#[hash_newtype(backward)]
|
||||||
|
struct NewTypeHash(_);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
# 0.14.0 - 2024-03-21
|
# 0.14.0 - 2024-03-21
|
||||||
|
|
||||||
* Bump MSRV to Rust version 1.56.1 [#2188](https://github.com/rust-bitcoin/rust-bitcoin/pull/2188)
|
* Bump MSRV to Rust version 1.56.1 [#2188](https://github.com/rust-bitcoin/rust-bitcoin/pull/2188)
|
||||||
|
|
|
@ -91,8 +91,8 @@ fn from_engine<T: Tag>(e: sha256::HashEngine) -> Hash<T> {
|
||||||
/// pub struct FooTag = hash_str("foo");
|
/// pub struct FooTag = hash_str("foo");
|
||||||
///
|
///
|
||||||
/// /// A foo hash.
|
/// /// A foo hash.
|
||||||
/// // Direction works just like in case of hash_newtype! macro.
|
/// // Direction works just like the hash_newtype! macro.
|
||||||
/// #[hash_newtype(forward)]
|
/// #[hash_newtype(backward)]
|
||||||
/// pub struct FooHash(_);
|
/// pub struct FooHash(_);
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
Loading…
Reference in New Issue