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

Possibility to handle case where bitpack discards bits? #9

Open
ptomato opened this issue May 15, 2023 · 0 comments
Open

Possibility to handle case where bitpack discards bits? #9

ptomato opened this issue May 15, 2023 · 0 comments

Comments

@ptomato
Copy link

ptomato commented May 15, 2023

Thanks for this wonderful crate, it makes very readable code!

As a feature request, it'd be convenient to be able to handle the case where set bits are getting discarded in bitpack!(). Sometimes the current behaviour of discarding bits is what I want, but sometimes it's not.

e.g. some API similar to bitpack!() that would get me a Result in the below case, which would be an error if the top 8 bits of a were not zero:

let a: u16 = 0x1234;
let b = bitpack!("0000_aaaa_0000_aaaa");
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

No branches or pull requests

1 participant