From 8ceaef72faaa5d36000089c415a5b28f7e244513 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 11 May 2024 00:36:27 +0200 Subject: [PATCH] add BitVec::len --- src/bit_vec.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bit_vec.rs b/src/bit_vec.rs index 68ee3b3..3a8de07 100644 --- a/src/bit_vec.rs +++ b/src/bit_vec.rs @@ -39,6 +39,10 @@ impl BitVec { self.data.fill(byte); } + pub fn len(&self) -> usize { + self.data.len() + } + fn get_indexes(&self, index: usize) -> (usize, u8) { let byte_index = index / 8; let bit_in_byte_index = 7 - index % 8;