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

Introduce BitSlice::from_bit{,_mut} methods #254

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

Conversation

mina86
Copy link

@mina86 mina86 commented Dec 4, 2023

Introduce BitSlice::from_bit and BitSlice::from_bit_mut methods to
easily in an infallible way construct a reference to a single bit of
an element.

For the most part, this is just a convenience wrapper around calling
.get(n..=n) on a slice constructed via from_element{,_mut} method
however in certain situations it makes it possible to avoid unwrapping
of the returned Option.

Introduce BitSlice::from_bit and BitSlice::from_bit_mut methods to
easily in an infallible way construct a reference to a single bit of
an element.

For the most part, this is just a convenience wrapper around calling
`.get(n..=n)` on a slice constructed via from_element{,_mut} method
however in certain situations it makes it possible to avoid unwrapping
of the returned Option.
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.

None yet

1 participant