units: Remove alloc from fee module

The fee module methods behind alloc perform only arithmetic operations, so they don't require heap allocation
This commit is contained in:
jrakibi 2025-02-11 19:00:46 +03:00
parent 9c3a52be88
commit 43a7c66f50
1 changed files with 0 additions and 2 deletions

View File

@ -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<FeeRate> {
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<FeeRate> {
// No `?` operator in const context.