Any SignedAmount can now be cast to Amount since the range is the same. Specifically, the range for SignedAmount is (- 21 million, 21 million) while the range for Amount is (0, 21 million). Therefore any value from Amount can be cast to a SignedAmount and it will work. Note it's not the same and still requires checking when going from SignedAmount to Amount since Amount can't handle the negative range. As a side effect of changing the return type, TryFrom is no longer valid and does not compile. Therefore in addition to changing the return type, TryFrom is also removed. |
||
---|---|---|
.. | ||
all-features.txt | ||
alloc-only.txt | ||
no-features.txt |