Merge rust-bitcoin/rust-bitcoin#6972: units: Use third person in rustdoc summaries
What changed, and why it matters
This commit only fixes the grammar of code documentation comments, changing phrases like 'Construct' to 'Constructs' and 'Attempt' to 'Attempts' in three source files. It does not change any actual program logic, function behavior, or security properties.
No security action needed. This is a non-functional documentation style cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch is a documentation-only change in rustdoc summaries across units/src/amount/signed.rs, units/src/block.rs, and units/src/locktime/relative/mod.rs. No executable code, type signatures, arithmetic, overflow handling, or public APIs were modified. The changes align rustdoc summaries with the project’s third-person style policy.
Changed components
units/src/amount/signed.rsunits/src/block.rsunits/src/locktime/relative/mod.rsInspect captured patch +12 / −11
### units/src/amount/signed.rs
@@ -145,7 +145,7 @@ impl SignedAmount {
}
}
- /// Construct a [`SignedAmount`] value from a `u64` satoshi value.
+ /// Constructs a [`SignedAmount`] value from a `u64` satoshi value.
///
/// # Errors
///
### units/src/block.rs
@@ -150,14 +150,15 @@ impl BlockHeight {
#[inline]
pub const fn to_u32(self) -> u32 { self.0 }
- /// Attempt to subtract two [`BlockHeight`]s, returning [`None`] if overflow occurred.
+ /// Attempts to subtract two [`BlockHeight`]s, returning [`None`] if overflow occurred.
#[inline]
#[must_use]
pub fn checked_sub(self, other: Self) -> Option<BlockHeightInterval> {
self.to_u32().checked_sub(other.to_u32()).map(BlockHeightInterval)
}
- /// Attempt to add an interval to this [`BlockHeight`], returning [`None`] if overflow occurred.
+ /// Attempts to add an interval to this [`BlockHeight`], returning [`None`] if overflow
+ /// occurred.
#[inline]
#[must_use]
pub fn checked_add(self, other: BlockHeightInterval) -> Option<Self> {
@@ -273,14 +274,14 @@ impl BlockHeightInterval {
#[inline]
pub const fn to_u32(self) -> u32 { self.0 }
- /// Attempt to subtract two [`BlockHeightInterval`]s, returning [`None`] if overflow occurred.
+ /// Attempts to subtract two [`BlockHeightInterval`]s, returning [`None`] if overflow occurred.
#[inline]
#[must_use]
pub fn checked_sub(self, other: Self) -> Option<Self> {
self.to_u32().checked_sub(other.to_u32()).map(Self)
}
- /// Attempt to add two [`BlockHeightInterval`]s, returning [`None`] if overflow occurred.
+ /// Attempts to add two [`BlockHeightInterval`]s, returning [`None`] if overflow occurred.
#[inline]
#[must_use]
pub fn checked_add(self, other: Self) -> Option<Self> {
@@ -357,14 +358,14 @@ impl BlockMtp {
Self::from_u32(u32::from(timestamps[5]))
}
- /// Attempt to subtract two [`BlockMtp`]s, returning [`None`] if overflow occurred.
+ /// Attempts to subtract two [`BlockMtp`]s, returning [`None`] if overflow occurred.
#[inline]
#[must_use]
pub fn checked_sub(self, other: Self) -> Option<BlockMtpInterval> {
self.to_u32().checked_sub(other.to_u32()).map(BlockMtpInterval)
}
- /// Attempt to add an interval to this [`BlockMtp`], returning [`None`] if overflow occurred.
+ /// Attempts to add an interval to this [`BlockMtp`], returning [`None`] if overflow occurred.
#[inline]
#[must_use]
pub fn checked_add(self, other: BlockMtpInterval) -> Option<Self> {
@@ -455,14 +456,14 @@ impl BlockMtpInterval {
relative::NumberOf512Seconds::from_seconds_ceil(self.to_u32())
}
- /// Attempt to subtract two [`BlockMtpInterval`]s, returning [`None`] if overflow occurred.
+ /// Attempts to subtract two [`BlockMtpInterval`]s, returning [`None`] if overflow occurred.
#[inline]
#[must_use]
pub fn checked_sub(self, other: Self) -> Option<Self> {
self.to_u32().checked_sub(other.to_u32()).map(Self)
}
- /// Attempt to add two [`BlockMtpInterval`]s, returning [`None`] if overflow occurred.
+ /// Attempts to add two [`BlockMtpInterval`]s, returning [`None`] if overflow occurred.
#[inline]
#[must_use]
pub fn checked_add(self, other: Self) -> Option<Self> {
### units/src/locktime/relative/mod.rs
@@ -427,7 +427,7 @@ impl NumberOfBlocks {
#[inline]
pub const fn from_count(blocks: u16) -> Self { Self(blocks) }
- /// Express the [`NumberOfBlocks`] as a count of blocks.
+ /// Expresses the [`NumberOfBlocks`] as a count of blocks.
#[inline]
#[must_use]
pub const fn to_count(self) -> u16 { self.0 }
@@ -542,7 +542,7 @@ impl NumberOf512Seconds {
#[inline]
pub const fn from_512_second_intervals(intervals: u16) -> Self { Self(intervals) }
- /// Express the [`NumberOf512Seconds`] as an integer number of 512-second intervals.
+ /// Expresses the [`NumberOf512Seconds`] as an integer number of 512-second intervals.
#[inline]
#[must_use]
pub const fn to_512_second_intervals(self) -> u16 { self.0 }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.