fix(docs): correct fee_rate, fee_wu and fee_vb descriptions
What changed, and why it matters
This commit only fixes documentation comments for two deprecated Rust functions. It does not change any executable code, so it cannot affect program behavior or security.
No security action needed; this is a documentation-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates doc comments in units/src/fee_rate/mod.rs for fee_wu and fee_vb to accurately describe what the deprecated wrappers do (e.g., fee_wu returns mul_by_weight(weight).ok(), and fee_vb fails when vb cannot be represented as Weight). No implementation code is modified.
Changed components
units/src/fee_rate/mod.rs (documentation only)Inspect captured patch +3 / −3
diff --git a/units/src/fee_rate/mod.rs b/units/src/fee_rate/mod.rs
index 2ee77b73..d45ce5ba 100644
--- a/units/src/fee_rate/mod.rs
+++ b/units/src/fee_rate/mod.rs
@@ -188,16 +188,16 @@ impl FeeRate {
/// Calculates the fee by multiplying this fee rate by weight, in weight units, returning [`None`]
/// if an overflow occurred.
///
- /// This is equivalent to `Self::checked_mul_by_weight()`.
+ /// This is equivalent to `Self::mul_by_weight(weight).ok()`.
#[must_use]
#[deprecated(since = "TBD", note = "use `to_fee()` instead")]
pub fn fee_wu(self, weight: Weight) -> Option<Amount> { self.mul_by_weight(weight).ok() }
/// Calculates the fee by multiplying this fee rate by weight, in virtual bytes, returning [`None`]
- /// if an overflow occurred.
+ /// if `vb` cannot be represented as [`Weight`].
///
/// This is equivalent to converting `vb` to [`Weight`] using [`Weight::from_vb`] and then calling
- /// `Self::fee_wu(weight)`.
+ /// [`Self::to_fee`].
#[must_use]
#[deprecated(since = "TBD", note = "use Weight::from_vb and then `to_fee()` instead")]
pub fn fee_vb(self, vb: u64) -> Option<Amount> { Weight::from_vb(vb).map(|w| self.to_fee(w)) }
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.