You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When iterating over a BitSlice using chunks_exact_mut() and step_by() with a step value greater than 1 and the last chunk lands perfectly at the end of the BitSlice, the last chunk is not returned.
let chunk_size = 2usize;let step_by = 3usize;letmut indexes = vec![0, 1, 2, 3, 4, 5, 6, 7];letmut bits = bitvec![0, 0, 0, 1, 1, 0, 1, 1];assert_eq!(indexes.len(), bits.len());println!("indexes.chunks_exact()");for s in indexes.chunks_exact(chunk_size).step_by(step_by){println!("{:?}", s);}println!("indexes.chunks_exact_mut()");for s in indexes.chunks_exact_mut(chunk_size).step_by(step_by){println!("{:?}", s);}println!("bits.chunks_exact()");for s in bits.chunks_exact(chunk_size).step_by(step_by){println!("{}", s);}println!("bits.chunks_exact_mut()");for s in bits.chunks_exact_mut(chunk_size).step_by(step_by){println!("{}", s);}
When iterating over a
BitSlice
usingchunks_exact_mut()
andstep_by()
with astep
value greater than 1 and the last chunk lands perfectly at the end of theBitSlice
, the last chunk is not returned.This prints
A similar error occurs when
but not when
The text was updated successfully, but these errors were encountered: