1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use crate::{BitLength, BitOrder, GetBit};

impl BitLength for bool {
    const BITS: usize = 1;
}

impl BitLength for &bool {
    const BITS: usize = 1;
}

impl<O> GetBit<O> for bool
where
    O: BitOrder,
{
    fn get_bit(&self, index: usize) -> bool {
        assert!(index < 1, "index out of bounds");
        *self
    }
}

impl<O> GetBit<O> for &bool
where
    O: BitOrder,
{
    fn get_bit(&self, index: usize) -> bool {
        assert!(index < 1, "index out of bounds");
        **self
    }
}