-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Pretty print 'long' units with long prefixes #309
Conversation
We plan to use this to signal that some units don't allow short prefixes, but as of now, I've just made the least ammount of changes to keep the current behavior and have the tests running.
Before this, we had: ``` >>> @metric_prefixes unit points @metric_prefixes unit points >>> megapoints megapoints = 1 Mpoints ``` Now we have: ``` >>> @metric_prefixes unit points @metric_prefixes unit points >>> megapoints megapoints = 1 megapoints ``` I've also added a roundtrip test.
9a5fcce
to
9a2cdc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much! Only a few minor comments.
Before this, it accepted a string and a AcceptsPrefix that were used to construct a CanonicalName internally. This also applies fixes suggested on the PR review [1], such as AcceptsPrefix inconsistencies on tests, code duplication on get_canonical_unit_name. [1]:sharkdp#309
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
Oh, hold on. This isn't actually fixed completely. Try typing |
Before this, it accepted a string and a AcceptsPrefix that were used to construct a CanonicalName internally. This also applies fixes suggested on the PR review [1], such as AcceptsPrefix inconsistencies on tests, code duplication on get_canonical_unit_name. [1]:#309
Thanks for the good work! |
This work is related to #133. Any feedbacks are welcome.
I've run the test case on the issue description and it seems to work as expected.
cargo test
passes with no errors and I've added a roundtrip check as required as well.If you want, I can squash or change the commits to better fit the project as well