varunsrin / rusty_money

Money library for Rust
MIT License
93 stars 34 forks source link

`Currency::minor_units` can be removed #101

Open alopatindev opened 1 year ago

alopatindev commented 1 year ago

(Taking into account that Currency is Copy, so we put all its fields on stack) Currency::minor_units seems to be redundant, because it can be computed from something like dec!(10).powd(-Currency::exponent)

davestearns commented 4 months ago

I might be missing something, but I don't see any place in the code where the minor_units field is even used.

https://github.com/search?q=repo%3Avarunsrin%2Frusty_money+minor_units&type=code

It's defined for the currencies, but I don't see any code that actually uses it. I only see uses of exponent. So yeah, I think this field could just be removed, right? Or am I missing something?

Nice job on this library!