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

Numeric trait impls for i64 and u64 missing #5

Closed
nhoyle opened this issue Jul 14, 2023 · 2 comments · Fixed by #6
Closed

Numeric trait impls for i64 and u64 missing #5

nhoyle opened this issue Jul 14, 2023 · 2 comments · Fixed by #6

Comments

@nhoyle
Copy link

nhoyle commented Jul 14, 2023

I had been using Formatter::fmt and casting my integer types to f64 to use it. I just did a cargo update, got told fmt was deprecated and to use fmt2. Saw that it supports any Numeric type. I thought "Great! I can use my integer types directly now, and avoid the cast I didn't want." I took the cast off of a u64 and passed it into fmt2 and was very surprised when the trait bound failed. As far as I can tell, after looking, it appears that there are Numeric trait impls for signed and unsigned 8, 16, 32, and 128 bit integers. Is there a reason we skipped 64-bit? It's the native register size on x86_64 architecture, as well as being a very useful size. I think this is simply missing, and should be present.

@kurtlawrence
Copy link
Owner

Whoops, I missed the inclusion of [i,u]64 in the macro 😵‍💫.

I've got a fix in the works and will get a release out soon, thanks for filing the issue.

@nhoyle
Copy link
Author

nhoyle commented Jul 14, 2023

I updated to the new crate version, and removed my casts, to use u64 types directly. Compiled fine, and a subsequent test run of the program in question ran as expected. Thanks for the quick turnaround on this issue!

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

Successfully merging a pull request may close this issue.

2 participants