From 43a7c66f50b663aee503c958c5158127fa0b8d5c Mon Sep 17 00:00:00 2001 From: jrakibi Date: Tue, 11 Feb 2025 19:00:46 +0300 Subject: [PATCH] units: Remove alloc from fee module The fee module methods behind alloc perform only arithmetic operations, so they don't require heap allocation --- units/src/fee.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/units/src/fee.rs b/units/src/fee.rs index 94601db87..472eb9370 100644 --- a/units/src/fee.rs +++ b/units/src/fee.rs @@ -33,7 +33,6 @@ impl Amount { /// let fee_rate = amount.checked_div_by_weight_ceil(weight).expect("Division by weight failed"); /// assert_eq!(fee_rate, FeeRate::from_sat_per_kwu(34)); /// ``` - #[cfg(feature = "alloc")] #[must_use] pub const fn checked_div_by_weight_ceil(self, weight: Weight) -> Option { let wu = weight.to_wu(); @@ -56,7 +55,6 @@ impl Amount { /// can be made. See also [`Self::checked_div_by_weight_ceil`]. /// /// Returns [`None`] if overflow occurred. - #[cfg(feature = "alloc")] #[must_use] pub const fn checked_div_by_weight_floor(self, weight: Weight) -> Option { // No `?` operator in const context.