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
30
31
32
33
34
35
36
37
38
39
40
41
//! bitmap32 is a library that provides the [`BitMap`] type and the [`BitSlice`] which are wrappers around slices and arrays.
//! bitmap32 can be used without the `std` and or `alloc` features for use in a `no-std` environment
//! ```rust
//!    # use bitmap32::BitMap;
//!    let mut map = BitMap::<u8, 2>([0b11001001, 0b11000000]);
//!
//!    assert_eq!(map.test(4), Some(true));
//!    assert_eq!(map.test(10), Some(false));
//!
//!    assert_eq!(map.set_checked(5), true);
//!    assert_eq!(map.test(5), Some(true));
//!
//!
//!    let mut map = BitMap::<u8, 2>::new();
//!    map.set_checked(14);
//!
//!    assert_eq!(map.ones().next(), Some(14));
//!```

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(clippy::complexity)]
#![deny(clippy::pedantic)]
#![allow(clippy::inline_always)]
#![allow(clippy::return_self_not_must_use)]
#![allow(clippy::must_use_candidate)]
#![allow(clippy::semicolon_if_nothing_returned)]
#![allow(clippy::module_name_repetitions)]

#[cfg(feature = "alloc")]
extern crate alloc;

pub use crate::bitmap::BitMap;
pub use crate::block::BitBlock;
pub use crate::block::LE;
pub use crate::slice::BitSlice;

mod bitmap;
mod block;
pub mod slice;

// pub use bit_block::BitBlock;