Skip to content

Commit 1bd8c74

Browse files
committed
Impl Eq for Store, Container, RoaringBitmap, RoaringTreemap
1 parent 9a363f5 commit 1bd8c74

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

roaring/src/bitmap/container.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub const RUN_MAX_SIZE: u64 = 2048;
1313
#[cfg(not(feature = "std"))]
1414
use alloc::vec::Vec;
1515

16-
#[derive(PartialEq, Clone)]
16+
#[derive(PartialEq, Eq, Clone)]
1717
pub(crate) struct Container {
1818
pub key: u16,
1919
pub store: Store,

roaring/src/bitmap/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use alloc::vec::Vec;
4444
/// rb.insert(7);
4545
/// println!("total bits set to true: {}", rb.len());
4646
/// ```
47-
#[derive(PartialEq)]
47+
#[derive(PartialEq, Eq)]
4848
pub struct RoaringBitmap {
4949
containers: Vec<container::Container>,
5050
}

roaring/src/bitmap/store/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,9 @@ impl PartialEq for Store {
852852
}
853853
}
854854

855+
// reflexivity: a == a.
856+
impl Eq for Store {}
857+
855858
impl Iter<'_> {
856859
/// Advance the iterator to the first value greater than or equal to `n`.
857860
pub(crate) fn advance_to(&mut self, n: u16) {

roaring/src/treemap/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub use self::iter::{BitmapIter, IntoIter, Iter};
3636
/// rb.insert(7);
3737
/// println!("total bits set to true: {}", rb.len());
3838
/// ```
39-
#[derive(PartialEq)]
39+
#[derive(PartialEq, Eq)]
4040
pub struct RoaringTreemap {
4141
map: BTreeMap<u32, RoaringBitmap>,
4242
}

0 commit comments

Comments
 (0)