Merge rust-bitcoin/rust-bitcoin#4044: units: Remove alloc from fee module
43a7c66f50
units: Remove alloc from fee module (jrakibi) Pull request description: This PR removes the `alloc` feature gating from fee module Closes #3815 ACKs for top commit: tcharding: ACK43a7c66f50
apoelstra: ACK 43a7c66f50b663aee503c958c5158127fa0b8d5c; successfully ran local tests; nice! Tree-SHA512: 645d50cd6cde915972a576d7282a5dfc9aa27a8c3a3b44d3f3eb7a7f066cb3a697bed7e757bc86766498d92cc534607960caf20c90a1ac6fabf9246db4b30249
This commit is contained in:
commit
e1cb0f1199
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue