Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit 9b124ca

Browse files
committed
Merge #153: Add docs to the code create by sha256t_hash_newtype macro
275adc6 Add docs to the code create by sha256t_hash_newtype macro (Tobin C. Harding) Pull request description: When using the `sha256t_hash_newtype` currently no docs are generated, this causes lint errors for users who lint for such things. Add docs to the new type created by the `sha256t_hash_newtype` macro. (This is identical to how we do it in the duplicate macro of the same name in `rust-bitcoin`, which can be removed in favour of this one after this patch is applied.) ACKs for top commit: apoelstra: ACK 275adc6 Tree-SHA512: cfeab98a3c8185b87a0144b36c42b89fd01766dd0e21d8e66652637b9ce3e466009051b538f61d4d033b2a54c0cb6e66607eecbde745dae737003cbf91d86a94
2 parents 28aaca5 + 275adc6 commit 9b124ca

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sha256t.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,14 @@ impl<T: Tag> HashTrait for Hash<T> {
143143
#[macro_export]
144144
macro_rules! sha256t_hash_newtype {
145145
($newtype:ident, $tag:ident, $midstate:ident, $midstate_len:expr, $docs:meta, $reverse: expr) => {
146-
/// The tag used for [$newtype].
146+
sha256t_hash_newtype!($newtype, $tag, $midstate, $midstate_len, $docs, $reverse, stringify!($newtype));
147+
};
148+
149+
($newtype:ident, $tag:ident, $midstate:ident, $midstate_len:expr, $docs:meta, $reverse: expr, $sname:expr) => {
150+
#[doc = "The tag used for ["]
151+
#[doc = $sname]
152+
#[doc = "]"]
153+
#[derive(Copy, Clone, PartialEq, Eq, Default, PartialOrd, Ord, Hash)]
147154
pub struct $tag;
148155

149156
impl $crate::sha256t::Tag for $tag {

0 commit comments

Comments
 (0)