719 B
719 B
Exclusive Bit-Slice Iteration
This view iterates each bit in the bit-slice by exclusive proxy reference. It is
created by the BitSlice::iter_mut method.
Original
API Differences
Because bitvec cannot manifest &mut bool references, this instead yields the
crate proxy reference. Because the proxy is a true type, rather than an
&mut reference, its name must be bound with mut in order to write through
it.
Examples
use bitvec::prelude::*;
let bits = bits![mut 0, 1];
for mut bit in bits.iter_mut() {
*bit = !*bit;
}
assert_eq!(bits, bits![1, 0]);