-
Notifications
You must be signed in to change notification settings - Fork 735
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 BitLength
for all bit-denoted lengths
#350
Comments
Searching for "8 ", " 8", "+ 7", and "/ 8" is a good way to find relevant code. |
Also, it's a good idea to update STYLE.md to mention the conventions for using |
Some work done on the branch mentioned on #346. If you're ok with that I'll go after the "/ 8" left in the codebase. |
In order to do this completely we'd need to handle non-usize types, especually |
See also #345, 346, #347.
Without the compiler supporting const fns, we are limited in the contexts in which we can use
BitLength
. @samscott89 noted that we may be able to makeBitLength
a newtypestruct BitLength(usize)
, which might be able to let us use it in more contexts before const fns are available. That sounds good to me, but we should add some TODO comments about reversing that once we have const fns.Similarly, we have code like this for converting from bits to bytes:
We could define a
bits_as_bytes_rounded_up!
macro that would allow us to write:Again, if we do that then we should have a TODO to remove the macro when const fns are available.
The text was updated successfully, but these errors were encountered: