Merge rust-bitcoin/rust-bitcoin#6971: units: Fix typos
What changed, and why it matters
This commit only fixes spelling mistakes in comments and documentation strings. No program logic, calculations, or security behavior was changed.
No security action needed; this is a documentation-only cleanup change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff consists entirely of typo corrections in Rust source comments and doc comments within the units crate: ‘denomintaions’→’denominations’, ‘opertaions’→’operations’, ‘reamainder’→’remainder’, ‘It an be’→’It can be’, ‘it to’→’is to’, and ‘21th’→’21st’. There are no code, API, or arithmetic changes.
Changed components
units/src/amount/mod.rsunits/src/amount/ops.rsunits/src/amount/unsigned.rsunits/src/lib.rsunits/src/locktime/absolute/mod.rsInspect captured patch +6 / −6
### units/src/amount/mod.rs
@@ -3,8 +3,8 @@
//! Bitcoin amounts.
//!
//! This module mainly introduces the [`Amount`] and [`SignedAmount`] types to express the bitcoin
-//! amounts supporting arithmetic, conversions between denomintaions and other important
-//! opertaions.
+//! amounts supporting arithmetic, conversions between denominations and other important
+//! operations.
//!
//! # The 21M limit
//!
### units/src/amount/ops.rs
@@ -224,7 +224,7 @@ crate::internal_macros::impl_op_for_references! {
impl ops::Rem<NonZeroI64> for SignedAmount {
type Output = SignedAmount;
- fn rem(self, modulus: NonZeroI64) -> Self::Output { SignedAmount::from_sat(self.to_sat() % modulus.get()).expect("construction from reamainder cannot fail") }
+ fn rem(self, modulus: NonZeroI64) -> Self::Output { SignedAmount::from_sat(self.to_sat() % modulus.get()).expect("construction from remainder cannot fail") }
}
impl ops::Rem<i64> for NumOpResult<SignedAmount> {
type Output = NumOpResult<SignedAmount>;
### units/src/amount/unsigned.rs
@@ -278,7 +278,7 @@ impl Amount {
/// Constructs an [`Amount`] from floating-point notation in the given [`Denomination`].
///
/// **Warning:** due to precision loss, using floats for financial operations is generally not
- /// recommended. It an be avoided by using an integer number of satoshis or string-encoded btc
+ /// recommended. It can be avoided by using an integer number of satoshis or string-encoded btc
/// in APIs that require it.
///
/// # Errors
### units/src/lib.rs
@@ -35,7 +35,7 @@
//!
//! ## Policy
//!
-//! Our MSRV policy it to only bump MSRV to the one that is available on the latest Debian stable
+//! Our MSRV policy is to only bump MSRV to the one that is available on the latest Debian stable
//! and is at least two years old. However, we will try to be even more conservative when practical
//! given this crate is very widely used.
//!
### units/src/locktime/absolute/mod.rs
@@ -937,7 +937,7 @@ mod tests {
#[test]
fn satisfied_by_time() {
- let time_before = MedianTimePast::from_u32(1_653_109_200).unwrap(); // "May 21th 2022, 5am UTC.
+ let time_before = MedianTimePast::from_u32(1_653_109_200).unwrap(); // "May 21st 2022, 5am UTC.
let time = MedianTimePast::from_u32(1_653_195_600).unwrap(); // "May 22nd 2022, 5am UTC.
let time_after = MedianTimePast::from_u32(1_653_282_000).unwrap(); // "May 23rd 2022, 5am UTC.
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.