/// Turn an iterator over u64 words into an iterator over bits that
/// are set (i.e. `1`) in these words, starting at bit position `start`
/// and moving in steps of size `2^step` per word.
Turn an iterator over u64 words into an iterator over bits that
are set  in these words, starting at bit position `start`
and moving in steps of size `2^step` per word.
Turn an iterator over u64 words into an iterator over bits that are set in these words starting at bit position ` start ` and moving in steps of size ` 2^step ` per word .
fn iter1s<'a, I>(iter: I, start: usize, step: usize) -> impl Iterator<Item = Bit1> + 'a
where
	I: Iterator<Item = u64> + 'a,
{
	debug_assert!(start < 64 && step < 7);
	let steps = (64 >> step) - (start >> step);
	iter.enumerate().flat_map(move |(i, word)| {
		let n = if word == 0 { 0 } else { steps };
		(0..n).filter_map(move |j| {
			let bit_pos = start + (j << step);
			if test_bit(word, bit_pos) {
				Some(Bit1 { position: i * 64 + bit_pos })
			} else {
				None
			}
		})
	})
}
fn iter1s < ' a , I > ( iter : I , start : usize , step : usize ) -> impl Iterator < Item = Bit1 > + ' a where I : Iterator < Item = u64 > + ' a , { debug_assert ! ( start 64 step 7 ) ; let steps = ( 64 >> step ) - ( start >> step ) ; iter . enumerate ( ) . flat_map ( move | ( i , word ) | { let n = if word == 0 { 0 } else { steps } ; ( 0 .. n ) . filter_map ( move | j | { let bit_pos = start + ( j << step ) ; if test_bit ( word , bit_pos ) { Some ( Bit1 { position : i * 64 + bit_pos } ) } else { None } } ) } ) }
Turn an iterator over u64 words into an iterator over bits that
are set (i.e.
Turn an iterator over u64 words into an iterator over bits that are set ( i . e .
iter
I
start
usize
step
usize