Merge rust-bitcoin/rust-bitcoin#2320: Remove `AddressInner` from rustdocs

08d2b203a5 Remove rustdoc about attribute (Tobin C. Harding)
eea0b697bf Fix stale docs (Tobin C. Harding)

Pull request description:

  Do two miner docs fixes.

  - Patch 1: Fixes some stale docs I left in when refactoring the `AddressInner` type.
  - Patch 2: Uses code comments instead of rustdoc and fixes the issue linked below.

  Fix: #2315

ACKs for top commit:
  sanket1729:
    utACK 08d2b203a5

Tree-SHA512: e68276473b451c02e230364d386d5b4b610c8ec73ff30e97e111cd339cc2238b65e08c9a83aac5f9d5d6c2e1dd1ee10fec727dfec3bca3cd7317b7049d689f4a
This commit is contained in:
Andrew Poelstra 2024-01-10 16:11:19 +00:00
commit 67793d04c3
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 4 additions and 8 deletions

View File

@ -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 },
@ -319,11 +318,8 @@ impl From<Network> 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<V = NetworkChecked>(AddressInner, PhantomData<V>)
where