Closed zancas closed 3 years ago
Is there another way to achieve the function of the use
statement?
If so, what are the pros and cons of using a use
?
The approach seems well-reasoned and the changes look fine.
Running cargo test --all
yields 3 passed tests.
test getinfo ... ok
test getblockchaininfo ... ok
test z_getnewaddress ... ok
Is there another way to achieve the function of the
use
statement?If so, what are the pros and cons of using a
use
?
In most situations, use foo::Blar
can be removed by explicitly pathing, i.e. replacing any calls to Blar
with foo::Blar
. However, in order to call a trait method, you need to bring the trait into scope by 'use'ing it. We like to do this by saying use Bandana as _
to make it clear the thing we are use
ing is being brought into scope, and not directly accessed.
This change makes all values that are read from JSON, and are numbers to be "Decimals".
Decimals have explicit-and-fixed precision. Numbers written down in JSON, also have explicit and fixed precision.
Because of this, the correct representation for JSON numbers is a Decimal.
The change is: