Skip to content

Commit d9d6856

Browse files
committed
util::amount: Make from_sat constructor constant
1 parent deb9734 commit d9d6856

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/amount.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl Amount {
346346
pub const MAX_MONEY: Amount = Amount(21_000_000 * 100_000_000);
347347

348348
/// Create an [Amount] with satoshi precision and the given number of satoshis.
349-
pub fn from_sat(satoshi: u64) -> Amount {
349+
pub const fn from_sat(satoshi: u64) -> Amount {
350350
Amount(satoshi)
351351
}
352352

@@ -633,7 +633,7 @@ impl SignedAmount {
633633
pub const MAX_MONEY: SignedAmount = SignedAmount(21_000_000 * 100_000_000);
634634

635635
/// Create an [SignedAmount] with satoshi precision and the given number of satoshis.
636-
pub fn from_sat(satoshi: i64) -> SignedAmount {
636+
pub const fn from_sat(satoshi: i64) -> SignedAmount {
637637
SignedAmount(satoshi)
638638
}
639639

0 commit comments

Comments
 (0)