woff2-no-std 0.3.4

WOFF2 decompression library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[derive(Clone, Copy)]
pub(super) struct Bitmap<'a> {
    bytes: &'a [u8],
}

impl<'a> Bitmap<'a> {
    pub(super) fn new(bytes: &'a [u8]) -> Self {
        Self { bytes }
    }

    pub(super) fn is_set(self, index: u16) -> bool {
        let index = index as usize;
        let byte = self.bytes[index / 8];
        let bit = 0x80 >> (index % 8);
        byte & bit != 0
    }
}