Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currency::minor_units can be removed #101

Open
alopatindev opened this issue Aug 25, 2023 · 1 comment
Open

Currency::minor_units can be removed #101

alopatindev opened this issue Aug 25, 2023 · 1 comment

Comments

@alopatindev
Copy link

alopatindev commented Aug 25, 2023

(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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants