Skip to content

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

Open
mina86 wants to merge 1 commit intoferrilab:mainfrom
mina86:c
Open

Introduce BitSlice::from_bit{,_mut} methods#254
mina86 wants to merge 1 commit intoferrilab:mainfrom
mina86:c

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.

1 participant