From a6adfd845c53229465d21e2c0a940a5971883c9c Mon Sep 17 00:00:00 2001 From: geekvest Date: Sun, 3 Mar 2024 13:41:23 +0800 Subject: [PATCH] fix some comments Signed-off-by: geekvest --- bitcoin/src/bip32.rs | 2 +- bitcoin/src/blockdata/block.rs | 2 +- bitcoin/src/blockdata/script/borrowed.rs | 4 ++-- bitcoin/src/parse.rs | 2 +- bitcoin/src/taproot/merkle_branch.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bitcoin/src/bip32.rs b/bitcoin/src/bip32.rs index 7a7432a3..d18eb590 100644 --- a/bitcoin/src/bip32.rs +++ b/bitcoin/src/bip32.rs @@ -251,7 +251,7 @@ impl serde::Serialize for ChildNumber { /// Trait that allows possibly failable conversion from a type into a /// derivation path pub trait IntoDerivationPath { - /// Convers a given type into a [`DerivationPath`] with possible error + /// Converts a given type into a [`DerivationPath`] with possible error fn into_derivation_path(self) -> Result; } diff --git a/bitcoin/src/blockdata/block.rs b/bitcoin/src/blockdata/block.rs index 49ea80f5..66d7efa3 100644 --- a/bitcoin/src/blockdata/block.rs +++ b/bitcoin/src/blockdata/block.rs @@ -47,7 +47,7 @@ impl From for WitnessMerkleNode { /// Bitcoin block header. /// /// Contains all the block's information except the actual transactions, but -/// including a root of a [merkle tree] commiting to all transactions in the block. +/// including a root of a [merkle tree] committing to all transactions in the block. /// /// [merkle tree]: https://en.wikipedia.org/wiki/Merkle_tree /// diff --git a/bitcoin/src/blockdata/script/borrowed.rs b/bitcoin/src/blockdata/script/borrowed.rs index b8af7cf6..a4bb14fb 100644 --- a/bitcoin/src/blockdata/script/borrowed.rs +++ b/bitcoin/src/blockdata/script/borrowed.rs @@ -59,7 +59,7 @@ use crate::taproot::{LeafVersion, TapLeafHash, TapNodeHash}; /// ## Memory safety /// /// The type is `#[repr(transparent)]` for internal purposes only! -/// No consumer crate may rely on the represenation of the struct! +/// No consumer crate may rely on the representation of the struct! /// /// ## References /// @@ -441,7 +441,7 @@ impl Script { /// In Bitcoin Core, there are two ways to count sigops, "accurate" and "legacy". /// This method uses "accurate" counting. This means that OP_CHECKMULTISIG and its /// verify variant count for N sigops where N is the number of pubkeys used in the - /// multisig. However, it will count for 20 sigops if CHECKMULTISIG is not preceeded by an + /// multisig. However, it will count for 20 sigops if CHECKMULTISIG is not preceded by an /// OP_PUSHNUM from 1 - 16 (this would be an invalid script) /// /// Bitcoin Core uses accurate counting for sigops contained within redeemScripts (P2SH) diff --git a/bitcoin/src/parse.rs b/bitcoin/src/parse.rs index 35eb4764..5e7ba138 100644 --- a/bitcoin/src/parse.rs +++ b/bitcoin/src/parse.rs @@ -55,7 +55,7 @@ impl AsRef for ParseIntError { fn as_ref(&self) -> &core::num::ParseIntError { &self.source } } -/// Not strictly neccessary but serves as a lint - avoids weird behavior if someone accidentally +/// Not strictly necessary but serves as a lint - avoids weird behavior if someone accidentally /// passes non-integer to the `parse()` function. pub(crate) trait Integer: FromStr + TryFrom + Sized diff --git a/bitcoin/src/taproot/merkle_branch.rs b/bitcoin/src/taproot/merkle_branch.rs index 887cbacf..0698be26 100644 --- a/bitcoin/src/taproot/merkle_branch.rs +++ b/bitcoin/src/taproot/merkle_branch.rs @@ -43,7 +43,7 @@ impl TaprootMerkleBranch { /// /// # Errors /// - /// The function returns an error if the the number of bytes is not an integer multiple of 32 or + /// The function returns an error if the number of bytes is not an integer multiple of 32 or /// if the number of hashes exceeds 128. pub fn decode(sl: &[u8]) -> Result { if sl.len() % TAPROOT_CONTROL_NODE_SIZE != 0 {