Standardize function doc Panics
Changed the function docs to have the same format of /// /// # Panics /// /// description
This commit is contained in:
parent
d0c1eb138c
commit
233a9133d8
|
@ -241,7 +241,7 @@ impl ScriptBuf {
|
||||||
|
|
||||||
/// Add a single instruction to the script.
|
/// Add a single instruction to the script.
|
||||||
///
|
///
|
||||||
/// ## Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// The method panics if the instruction is a data push with length greater or equal to
|
/// The method panics if the instruction is a data push with length greater or equal to
|
||||||
/// 0x100000000.
|
/// 0x100000000.
|
||||||
|
|
|
@ -235,7 +235,7 @@ mod primitive {
|
||||||
|
|
||||||
/// Remove the byte at `index` and return it.
|
/// Remove the byte at `index` and return it.
|
||||||
///
|
///
|
||||||
/// ## Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// This method panics if `index` is out of bounds.
|
/// This method panics if `index` is out of bounds.
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
|
|
|
@ -216,6 +216,8 @@ impl PartialMerkleTree {
|
||||||
/// The `txids` are the transaction hashes of the block and the `matches` is the contains flags
|
/// The `txids` are the transaction hashes of the block and the `matches` is the contains flags
|
||||||
/// wherever a tx hash should be included in the proof.
|
/// wherever a tx hash should be included in the proof.
|
||||||
///
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
/// Panics when `txids` is empty or when `matches` has a different length
|
/// Panics when `txids` is empty or when `matches` has a different length
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
|
|
|
@ -71,7 +71,7 @@ impl Psbt {
|
||||||
///
|
///
|
||||||
/// The function returns error when UTXO information is not present or is invalid.
|
/// The function returns error when UTXO information is not present or is invalid.
|
||||||
///
|
///
|
||||||
/// ## Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// The function panics if the length of transaction inputs is not equal to the length of PSBT inputs.
|
/// The function panics if the length of transaction inputs is not equal to the length of PSBT inputs.
|
||||||
pub fn iter_funding_utxos(&self) -> impl Iterator<Item = Result<&TxOut, Error>> {
|
pub fn iter_funding_utxos(&self) -> impl Iterator<Item = Result<&TxOut, Error>> {
|
||||||
|
|
|
@ -133,7 +133,7 @@ impl<'a> TryFrom<&'a SerializedSignature> for Signature {
|
||||||
impl SerializedSignature {
|
impl SerializedSignature {
|
||||||
/// Creates `SerializedSignature` from data and length.
|
/// Creates `SerializedSignature` from data and length.
|
||||||
///
|
///
|
||||||
/// ## Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// If `len` > `MAX_LEN`
|
/// If `len` > `MAX_LEN`
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
@ -886,7 +886,7 @@ impl Amount {
|
||||||
/// Convert from a value expressing integer values of bitcoins to an [Amount]
|
/// Convert from a value expressing integer values of bitcoins to an [Amount]
|
||||||
/// in const context.
|
/// in const context.
|
||||||
///
|
///
|
||||||
/// ## Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// The function panics if the argument multiplied by the number of sats
|
/// The function panics if the argument multiplied by the number of sats
|
||||||
/// per bitcoin overflows a u64 type.
|
/// per bitcoin overflows a u64 type.
|
||||||
|
@ -1046,12 +1046,20 @@ impl Amount {
|
||||||
|
|
||||||
/// Unchecked addition.
|
/// Unchecked addition.
|
||||||
///
|
///
|
||||||
/// Computes `self + rhs`. Panics in debug mode, wraps in release mode.
|
/// Computes `self + rhs`.
|
||||||
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
|
/// On overflow, panics in debug mode, wraps in release mode.
|
||||||
pub fn unchecked_add(self, rhs: Amount) -> Amount { Self(self.0 + rhs.0) }
|
pub fn unchecked_add(self, rhs: Amount) -> Amount { Self(self.0 + rhs.0) }
|
||||||
|
|
||||||
/// Unchecked subtraction.
|
/// Unchecked subtraction.
|
||||||
///
|
///
|
||||||
/// Computes `self - rhs`. Panics in debug mode, wraps in release mode.
|
/// Computes `self - rhs`.
|
||||||
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
|
/// On overflow, panics in debug mode, wraps in release mode.
|
||||||
pub fn unchecked_sub(self, rhs: Amount) -> Amount { Self(self.0 - rhs.0) }
|
pub fn unchecked_sub(self, rhs: Amount) -> Amount { Self(self.0 - rhs.0) }
|
||||||
|
|
||||||
/// Convert to a signed amount.
|
/// Convert to a signed amount.
|
||||||
|
@ -1434,12 +1442,20 @@ impl SignedAmount {
|
||||||
|
|
||||||
/// Unchecked addition.
|
/// Unchecked addition.
|
||||||
///
|
///
|
||||||
/// Computes `self + rhs`. Panics in debug mode, wraps in release mode.
|
/// Computes `self + rhs`.
|
||||||
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
|
/// On overflow, panics in debug mode, wraps in release mode.
|
||||||
pub fn unchecked_add(self, rhs: SignedAmount) -> SignedAmount { Self(self.0 + rhs.0) }
|
pub fn unchecked_add(self, rhs: SignedAmount) -> SignedAmount { Self(self.0 + rhs.0) }
|
||||||
|
|
||||||
/// Unchecked subtraction.
|
/// Unchecked subtraction.
|
||||||
///
|
///
|
||||||
/// Computes `self - rhs`. Panics in debug mode, wraps in release mode.
|
/// Computes `self - rhs`.
|
||||||
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
|
/// On overflow, panics in debug mode, wraps in release mode.
|
||||||
pub fn unchecked_sub(self, rhs: SignedAmount) -> SignedAmount { Self(self.0 - rhs.0) }
|
pub fn unchecked_sub(self, rhs: SignedAmount) -> SignedAmount { Self(self.0 - rhs.0) }
|
||||||
|
|
||||||
/// Subtraction that doesn't allow negative [SignedAmount]s.
|
/// Subtraction that doesn't allow negative [SignedAmount]s.
|
||||||
|
|
Loading…
Reference in New Issue