BitVec::get() takes immutable self

This commit is contained in:
Chris Fallin
2021-05-05 23:08:19 -07:00
parent 15ed2d6522
commit 48fbc235ea

View File

@@ -66,7 +66,7 @@ impl BitVec {
} }
#[inline(always)] #[inline(always)]
pub fn get(&mut self, idx: usize) -> bool { pub fn get(&self, idx: usize) -> bool {
let word = idx / BITS_PER_WORD; let word = idx / BITS_PER_WORD;
let bit = idx % BITS_PER_WORD; let bit = idx % BITS_PER_WORD;
if word >= self.bits.len() { if word >= self.bits.len() {