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

Use fully-qualified syntax for ::BITS and prep for stdlib stabilization #57

Closed
wants to merge 1 commit into from

Conversation

myrrlyn
Copy link
Collaborator

@myrrlyn myrrlyn commented Feb 13, 2021

This commit only replaces each unqualified use of $type::BITS with <$type as crate::util::Integer>::BITS as usize, and marks the Integer::BITS constant as a u32.

This change allows core to stabilize the BITS constant on the integer primitives.

Once core stabilizes the constant, you can replace the definition from mem::size_of::<$t>() * 8 to <$t>::BITS. You will also be able to strip the < as crate::util::Integer>:: qualification syntax from most of the use sites, which use known typenames rather than trait-only generics.


In a followup PR, if you assent, I will replace much of the Integer trait with my funty crate so that you do not need to have the maintenance burden of integer typing going forward.

@myrrlyn
Copy link
Collaborator Author

myrrlyn commented Feb 13, 2021

I didn't see #56 until after I wrote this. Closing in favor of that.

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 this pull request may close these issues.

1 participant