Skip to content

Commit d9f844b

Browse files
committed
Merge rust-bitcoin/rust-bitcoin#902: util::amount: Make from_sat constructor constant
31571ca util::amount: Make from_sat constructor constant (Steven Roose) Pull request description: Currently unmergable because of MSRV but I heard talk about bumping it, so once it's bumped, this is a very much needed change :) ACKs for top commit: tcharding: ACK 31571ca apoelstra: ACK 31571ca Tree-SHA512: f254eb10a4349d890e29ea5fae77536429c7e731362cf2edcf2fe98ec9cbf2d8bbf65f98dfc8f0b80bac89960de688005d066a116d6cb62cca1efa9c1151f2ae
2 parents 9fae3e0 + d9d6856 commit d9f844b

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)