add BitVec::len

This commit is contained in:
Vinzenz Schroeter 2024-05-11 00:36:27 +02:00
parent 571cf73510
commit 8ceaef72fa

View file

@ -39,6 +39,10 @@ impl BitVec {
self.data.fill(byte); self.data.fill(byte);
} }
pub fn len(&self) -> usize {
self.data.len()
}
fn get_indexes(&self, index: usize) -> (usize, u8) { fn get_indexes(&self, index: usize) -> (usize, u8) {
let byte_index = index / 8; let byte_index = index / 8;
let bit_in_byte_index = 7 - index % 8; let bit_in_byte_index = 7 - index % 8;