From 8152ed758c023851e198c57c8461d6847f683355 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sun, 4 Aug 2019 19:27:36 +0000 Subject: [PATCH] Fix typos --- src/blockdata/opcodes.rs | 2 +- src/util/amount.rs | 10 +++++----- src/util/bip158.rs | 2 +- src/util/bip32.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/blockdata/opcodes.rs b/src/blockdata/opcodes.rs index 96da7673..724b16c2 100644 --- a/src/blockdata/opcodes.rs +++ b/src/blockdata/opcodes.rs @@ -273,7 +273,7 @@ pub mod all { pub const OP_2SWAP: All = All {code: 0x72}; /// Duplicate the top stack element unless it is zero pub const OP_IFDUP: All = All {code: 0x73}; - /// Push the current number of stack items onto te stack + /// Push the current number of stack items onto the stack pub const OP_DEPTH: All = All {code: 0x74}; /// Drops the top stack item pub const OP_DROP: All = All {code: 0x75}; diff --git a/src/util/amount.rs b/src/util/amount.rs index 866b3d40..b0d00de9 100644 --- a/src/util/amount.rs +++ b/src/util/amount.rs @@ -158,7 +158,7 @@ fn parse_signed_to_satoshi( // If precision diff is negative, this means we are parsing // into a less precise amount. That is not allowed unless // there are no decimals and the last digits are zeroes as - // many as the diffence in precision. + // many as the difference in precision. let last_n = precision_diff.abs() as usize; if s.contains(".") || s.chars().rev().take(last_n).any(|d| d != '0') { return Err(ParseAmountError::TooPrecise); @@ -252,7 +252,7 @@ fn fmt_satoshi_in( /// Amount /// /// The [Amount] type can be used to express Bitcoin amounts that supports -/// arithmetic and convertion to various denominations. +/// arithmetic and conversion to various denominations. /// /// /// Warning! @@ -387,7 +387,7 @@ impl Amount { buf } - // Some arithmethic that doesn't fit in `std::ops` traits. + // Some arithmetic that doesn't fit in `std::ops` traits. /// Checked addition. /// Returns [None] if overflow occurred. @@ -552,7 +552,7 @@ impl FromStr for Amount { /// SignedAmount /// /// The [SignedAmount] type can be used to express Bitcoin amounts that supports -/// arithmetic and convertion to various denominations. +/// arithmetic and conversion to various denominations. /// /// /// Warning! @@ -684,7 +684,7 @@ impl SignedAmount { buf } - // Some arithmethic that doesn't fit in `std::ops` traits. + // Some arithmetic that doesn't fit in `std::ops` traits. /// Get the absolute value of this [SignedAmount]. pub fn abs(self) -> SignedAmount { diff --git a/src/util/bip158.rs b/src/util/bip158.rs index 30aee13a..e41257b1 100644 --- a/src/util/bip158.rs +++ b/src/util/bip158.rs @@ -436,7 +436,7 @@ impl GCSFilter { return Ok((q << self.p) + r); } - /// Hash an arbitary slice with siphash using parameters of this filter + /// Hash an arbitrary slice with siphash using parameters of this filter fn hash(&self, element: &[u8]) -> u64 { siphash24::Hash::hash_to_u64_with_keys(self.k0, self.k1, element) } diff --git a/src/util/bip32.rs b/src/util/bip32.rs index 62653899..0f3079f8 100644 --- a/src/util/bip32.rs +++ b/src/util/bip32.rs @@ -749,7 +749,7 @@ mod tests { } #[test] - fn test_derivation_path_convertion_index() { + fn test_derivation_path_conversion_index() { let path = DerivationPath::from_str("m/0h/1/2'").unwrap(); let numbers: Vec = path.clone().into(); let path2: DerivationPath = numbers.into();