bitvek 0.3.8

A simple bit vector implementation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::BitVec;
use core::ops::Index;

impl Index<usize> for BitVec {
    type Output = bool;

    #[inline]
    fn index(&self, index: usize) -> &Self::Output {
        match self.get(index) {
            Some(true) => &true,
            Some(false) => &false,
            None => panic!("index out of bounds"),
        }
    }
}