From eea0b697bf281cbe5036f7783a957b131db1b20b Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 8 Jan 2024 13:38:46 +1100 Subject: [PATCH 1/2] Fix stale docs Recently we modified the `AddressInner` type but the docs are stale (FTR the type is private). Remove the stale sentence. --- bitcoin/src/address/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bitcoin/src/address/mod.rs b/bitcoin/src/address/mod.rs index 9934f5ab..9f374cdf 100644 --- a/bitcoin/src/address/mod.rs +++ b/bitcoin/src/address/mod.rs @@ -132,9 +132,8 @@ impl NetworkValidation for NetworkUnchecked { /// The inner representation of an address, without the network validation tag. /// -/// An `Address` is composed of a payload and a network. This struct represents the inner -/// representation of an address without the network validation tag, which is used to ensure that -/// addresses are used only on the appropriate network. +/// This struct represents the inner representation of an address without the network validation +/// tag, which is used to ensure that addresses are used only on the appropriate network. #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] enum AddressInner { P2pkh { hash: PubkeyHash, network: NetworkKind }, From 08d2b203a52077f24a2441daeb59343fcdac3fef Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 8 Jan 2024 13:43:01 +1100 Subject: [PATCH 2/2] Remove rustdoc about attribute Attributes are a code level thing, they should not be documented using rustdoc. Use code comments and simplify the comment. --- bitcoin/src/address/mod.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bitcoin/src/address/mod.rs b/bitcoin/src/address/mod.rs index 9f374cdf..d1d8175e 100644 --- a/bitcoin/src/address/mod.rs +++ b/bitcoin/src/address/mod.rs @@ -318,11 +318,8 @@ impl From for KnownHrp { /// * [BIP341 - Taproot: SegWit version 1 spending rules](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki) /// * [BIP350 - Bech32m format for v1+ witness addresses](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki) #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -/// -/// The `#[repr(transparent)]` attribute is used to guarantee that the layout of the -/// `Address` struct is the same as the layout of the `AddressInner` struct. This attribute is -/// an implementation detail and users should not rely on it in their code. -/// +// The `#[repr(transparent)]` attribute is used to guarantee the layout of the `Address` struct. It +// is an implementation detail and users should not rely on it in their code. #[repr(transparent)] pub struct Address(AddressInner, PhantomData) where