itybity 0.3.3

An itty bitty crate providing bit iterators and bit iterator accessories.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::FromBitIterator;

impl<const N: usize, T> FromBitIterator for [T; N]
where
    T: FromBitIterator,
{
    fn from_lsb0_iter(iter: impl IntoIterator<Item = bool>) -> Self {
        let mut iter = iter.into_iter();
        core::array::from_fn(|_| T::from_lsb0_iter(iter.by_ref()))
    }

    fn from_msb0_iter(iter: impl IntoIterator<Item = bool>) -> Self {
        let mut iter = iter.into_iter();
        core::array::from_fn(|_| T::from_msb0_iter(iter.by_ref()))
    }
}