Make `Amount::to_sat` and `SignedAmount::to_sat` const

This commit is contained in:
Casey Rodarmor 2024-10-19 11:49:14 -07:00
parent 51d503730d
commit 1d2cfb036c
1 changed files with 2 additions and 2 deletions

View File

@ -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")]