]> Untitled Git - bdk/commit
Make constructor functions on `FeeRate` const
authorThomas Eizinger <thomas@eizinger.io>
Fri, 26 Feb 2021 03:15:46 +0000 (14:15 +1100)
committerThomas Eizinger <thomas@eizinger.io>
Mon, 1 Mar 2021 00:04:39 +0000 (11:04 +1100)
commitfdde0e691ecfb415021ee3a79ba5c7e3153a8be8
tree86ef9d491e0460a810e70d3b01990979a69089f9
parent1cbd47b988258dd4a1a473de0ae9eeeb82066e25
Make constructor functions on `FeeRate` const

This allows `FeeRate`s to be stored inside `const`s.

For example:

const MY_FEE_RATE: FeeRate = FeeRate::from_sat_per_vb(10.0);

Unfortunately, floating point maths inside const expressions is
still unstable, hence we cannot make `from_btc_per_kvb` const.
CHANGELOG.md
src/types.rs