Merge rust-bitcoin/rust-bitcoin#3493: Make `Amount::to_sat` and `SignedAmount::to_sat` const
1d2cfb036c
Make `Amount::to_sat` and `SignedAmount::to_sat` const (Casey Rodarmor) Pull request description: Fixes #3491. ACKs for top commit: tcharding: ACK1d2cfb036c
apoelstra: ACK 1d2cfb036cff1088420e42a817b4a672e65e5d4b; successfully ran local tests Tree-SHA512: fc88202176afefb7ff75ad362cb9f139523db0a3d57821e5078af9fead9276b36fa7c915f197c45d4097c73e6bac6a1e72c012007ba9789d92a5514ab1d30f32
This commit is contained in:
commit
f981534be6
|
@ -887,7 +887,7 @@ impl Amount {
|
|||
pub const fn from_sat(satoshi: u64) -> Amount { Amount(satoshi) }
|
||||
|
||||
/// Gets the number of satoshis in this [`Amount`].
|
||||
pub fn to_sat(self) -> u64 { self.0 }
|
||||
pub const fn to_sat(self) -> u64 { self.0 }
|
||||
|
||||
/// Converts from a value expressing bitcoins to an [`Amount`].
|
||||
#[cfg(feature = "alloc")]
|
||||
|
@ -1313,7 +1313,7 @@ impl SignedAmount {
|
|||
pub const fn from_sat(satoshi: i64) -> SignedAmount { SignedAmount(satoshi) }
|
||||
|
||||
/// Gets the number of satoshis in this [`SignedAmount`].
|
||||
pub fn to_sat(self) -> i64 { self.0 }
|
||||
pub const fn to_sat(self) -> i64 { self.0 }
|
||||
|
||||
/// Convert from a value expressing bitcoins to an [`SignedAmount`].
|
||||
#[cfg(feature = "alloc")]
|
||||
|
|
Loading…
Reference in New Issue