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

Added associated constant BITS #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bluecube
Copy link

@bluecube bluecube commented Oct 14, 2022

This matches rust primitive types since 1.53.0, helps a bit when using this crate's types with macros.

This matches rust primitive types since 1.53.0
@bbaldino
Copy link
Collaborator

I actually came into a use case that'd need something like this recently...I was wondering if it'd be nice to also introduce a trait that defined BITS, MAX, MIN and new such that it'd be easier to write generic methods for any uX type that needed to access those properties.

@bluecube
Copy link
Author

it would probably be best to implement traits from num_traits. Bounded for this use case.

@bbaldino
Copy link
Collaborator

it would probably be best to implement traits from num_traits. Bounded for this use case.

Yeah that probably makes sense. Too bad there doesn't appear one that would map to BITS here though, but maybe just that could be defined in a new trait.

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.

2 participants