diff --git a/src/blockdata/opcodes.rs b/src/blockdata/opcodes.rs index 697eee54..f305115b 100644 --- a/src/blockdata/opcodes.rs +++ b/src/blockdata/opcodes.rs @@ -196,41 +196,41 @@ pub mod all { pub const OP_PUSHDATA2: All = All {code: 0x4d}; /// Read the next 4 bytes as N; push the next N bytes as an array onto the stack pub const OP_PUSHDATA4: All = All {code: 0x4e}; - /// Push the array [0x81] onto the stack + /// Push the array `0x81` onto the stack pub const OP_PUSHNUM_NEG1: All = All {code: 0x4f}; /// Synonym for OP_RETURN pub const OP_RESERVED: All = All {code: 0x50}; - /// Push the array [0x01] onto the stack + /// Push the array `0x01` onto the stack pub const OP_PUSHNUM_1: All = All {code: 0x51}; - /// Push the array [0x02] onto the stack + /// Push the array `0x02` onto the stack pub const OP_PUSHNUM_2: All = All {code: 0x52}; - /// Push the array [0x03] onto the stack + /// Push the array `0x03` onto the stack pub const OP_PUSHNUM_3: All = All {code: 0x53}; - /// Push the array [0x04] onto the stack + /// Push the array `0x04` onto the stack pub const OP_PUSHNUM_4: All = All {code: 0x54}; - /// Push the array [0x05] onto the stack + /// Push the array `0x05` onto the stack pub const OP_PUSHNUM_5: All = All {code: 0x55}; - /// Push the array [0x06] onto the stack + /// Push the array `0x06` onto the stack pub const OP_PUSHNUM_6: All = All {code: 0x56}; - /// Push the array [0x07] onto the stack + /// Push the array `0x07` onto the stack pub const OP_PUSHNUM_7: All = All {code: 0x57}; - /// Push the array [0x08] onto the stack + /// Push the array `0x08` onto the stack pub const OP_PUSHNUM_8: All = All {code: 0x58}; - /// Push the array [0x09] onto the stack + /// Push the array `0x09` onto the stack pub const OP_PUSHNUM_9: All = All {code: 0x59}; - /// Push the array [0x0a] onto the stack + /// Push the array `0x0a` onto the stack pub const OP_PUSHNUM_10: All = All {code: 0x5a}; - /// Push the array [0x0b] onto the stack + /// Push the array `0x0b` onto the stack pub const OP_PUSHNUM_11: All = All {code: 0x5b}; - /// Push the array [0x0c] onto the stack + /// Push the array `0x0c` onto the stack pub const OP_PUSHNUM_12: All = All {code: 0x5c}; - /// Push the array [0x0d] onto the stack + /// Push the array `0x0d` onto the stack pub const OP_PUSHNUM_13: All = All {code: 0x5d}; - /// Push the array [0x0e] onto the stack + /// Push the array `0x0e` onto the stack pub const OP_PUSHNUM_14: All = All {code: 0x5e}; - /// Push the array [0x0f] onto the stack + /// Push the array `0x0f` onto the stack pub const OP_PUSHNUM_15: All = All {code: 0x5f}; - /// Push the array [0x10] onto the stack + /// Push the array `0x10` onto the stack pub const OP_PUSHNUM_16: All = All {code: 0x60}; /// Does nothing pub const OP_NOP: All = All {code: 0x61}; diff --git a/src/blockdata/script.rs b/src/blockdata/script.rs index 1486bc6d..2d5f5952 100644 --- a/src/blockdata/script.rs +++ b/src/blockdata/script.rs @@ -431,7 +431,7 @@ impl Script { /// iterator will end. To instead iterate over the script as sequence of bytes, treat /// it as a slice using `script[..]` or convert it to a vector using `into_bytes()`. /// - /// To force minimal pushes, use [instructions_minimal]. + /// To force minimal pushes, use [Self::instructions_minimal]. pub fn instructions(&self) -> Instructions { Instructions { data: &self.0[..], diff --git a/src/blockdata/transaction.rs b/src/blockdata/transaction.rs index 6514c1b0..d531729b 100644 --- a/src/blockdata/transaction.rs +++ b/src/blockdata/transaction.rs @@ -697,7 +697,7 @@ impl SigHashType { /// Reads a 4-byte uint32 as a sighash type. /// /// **Note**: this replicates consensus behaviour, for current standardness rules correctness - /// you probably want [from_u32_standard]. + /// you probably want [Self::from_u32_standard]. pub fn from_u32_consensus(n: u32) -> SigHashType { // In Bitcoin Core, the SignatureHash function will mask the (int32) value with // 0x1f to (apparently) deactivate ACP when checking for SINGLE and NONE bits. diff --git a/src/network/address.rs b/src/network/address.rs index 1ee27bb2..107bb116 100644 --- a/src/network/address.rs +++ b/src/network/address.rs @@ -48,7 +48,7 @@ impl Address { } /// Extract socket address from an [Address] message. - /// This will return [io::Error] [ErrorKind::AddrNotAvailable] + /// This will return [io::Error] [io::ErrorKind::AddrNotAvailable] /// if the message contains a Tor address. pub fn socket_addr(&self) -> Result { let addr = &self.address; @@ -249,7 +249,7 @@ pub struct AddrV2Message { impl AddrV2Message { /// Extract socket address from an [AddrV2Message] message. - /// This will return [io::Error] [ErrorKind::AddrNotAvailable] + /// This will return [io::Error] [io::ErrorKind::AddrNotAvailable] /// if the address type can't be converted into a [SocketAddr]. pub fn socket_addr(&self) -> Result { match self.addr { diff --git a/src/network/message.rs b/src/network/message.rs index a19a9c5a..01c57e74 100644 --- a/src/network/message.rs +++ b/src/network/message.rs @@ -32,7 +32,7 @@ use network::message_filter; use consensus::encode::{CheckedData, Decodable, Encodable, VarInt, MAX_VEC_SIZE}; use consensus::{encode, serialize}; -/// The maximum number of [Inventory] items in an `inv` message. +/// The maximum number of [super::message_blockdata::Inventory] items in an `inv` message. /// /// This limit is not currently enforced by this implementation. pub const MAX_INV_SIZE: usize = 50_000; @@ -187,7 +187,7 @@ impl NetworkMessage { /// /// This returns `"unknown"` for [NetworkMessage::Unknown], /// regardless of the actual command in the unknown message. - /// Use the [command] method to get the command for unknown messages. + /// Use the [Self::command] method to get the command for unknown messages. pub fn cmd(&self) -> &'static str { match *self { NetworkMessage::Version(_) => "version", @@ -236,7 +236,7 @@ impl RawNetworkMessage { /// /// This returns `"unknown"` for [NetworkMessage::Unknown], /// regardless of the actual command in the unknown message. - /// Use the [command] method to get the command for unknown messages. + /// Use the [Self::command] method to get the command for unknown messages. pub fn cmd(&self) -> &'static str { self.payload.cmd() } diff --git a/src/util/amount.rs b/src/util/amount.rs index f2fb3fee..a732c440 100644 --- a/src/util/amount.rs +++ b/src/util/amount.rs @@ -312,9 +312,9 @@ impl Amount { } /// Parses amounts with denomination suffix like they are produced with - /// [to_string_with_denomination] or with [fmt::Display]. + /// [Self::to_string_with_denomination] or with [fmt::Display]. /// If you want to parse only the amount without the denomination, - /// use [from_str_in]. + /// use [Self::from_str_in]. pub fn from_str_with_denomination(s: &str) -> Result { let mut split = s.splitn(3, ' '); let amt_str = split.next().unwrap(); @@ -590,9 +590,9 @@ impl SignedAmount { } /// Parses amounts with denomination suffix like they are produced with - /// [to_string_with_denomination] or with [fmt::Display]. + /// [Self::to_string_with_denomination] or with [fmt::Display]. /// If you want to parse only the amount without the denomination, - /// use [from_str_in]. + /// use [Self::from_str_in]. pub fn from_str_with_denomination(s: &str) -> Result { let mut split = s.splitn(3, ' '); let amt_str = split.next().unwrap(); @@ -731,7 +731,7 @@ impl SignedAmount { } /// Subtraction that doesn't allow negative [SignedAmount]s. - /// Returns [None] if either [self], [rhs] or the result is strictly negative. + /// Returns [None] if either [self], `rhs` or the result is strictly negative. pub fn positive_sub(self, rhs: SignedAmount) -> Option { if self.is_negative() || rhs.is_negative() || rhs > self { None diff --git a/src/util/bip32.rs b/src/util/bip32.rs index 7e544d3a..26dbbe03 100644 --- a/src/util/bip32.rs +++ b/src/util/bip32.rs @@ -304,7 +304,7 @@ impl FromStr for DerivationPath { /// An iterator over children of a [DerivationPath]. /// -/// It is returned by the methods [DerivationPath::children_since], +/// It is returned by the methods [DerivationPath::children_from], /// [DerivationPath::normal_children] and [DerivationPath::hardened_children]. pub struct DerivationPathIterator<'a> { base: &'a DerivationPath, diff --git a/src/util/misc.rs b/src/util/misc.rs index 571889ad..75114d0e 100644 --- a/src/util/misc.rs +++ b/src/util/misc.rs @@ -128,7 +128,7 @@ mod message_signing { /// Attempt to recover a public key from the signature and the signed message. /// - /// To get the message hash from a message, use [signed_msg_hash]. + /// To get the message hash from a message, use [super::signed_msg_hash]. pub fn recover_pubkey( &self, secp_ctx: &secp256k1::Secp256k1, @@ -144,7 +144,7 @@ mod message_signing { /// Verify that the signature signs the message and was signed by the given address. /// - /// To get the message hash from a message, use [signed_msg_hash]. + /// To get the message hash from a message, use [super::signed_msg_hash]. pub fn is_signed_by_address( &self, secp_ctx: &secp256k1::Secp256k1,