Skip to content

Commit

Permalink
Merge pull request #65 from Kerollmops/bitmap-better-debug
Browse files Browse the repository at this point in the history
Implement a better Debug for the Bitmap
  • Loading branch information
saulius committed Jan 4, 2021
2 parents 9765830 + 3fa8697 commit 57c2f7a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion croaring/src/bitmap/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ use super::{ffi, Bitmap};

impl fmt::Debug for Bitmap {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Bitmap<{:?}>", self.to_vec())
if self.cardinality() < 32 {
write!(f, "Bitmap<{:?}>", self.to_vec())
} else {
write!(
f,
"Bitmap<{:?} values between {:?} and {:?}>",
self.cardinality(),
self.minimum().unwrap(),
self.maximum().unwrap()
)
}
}
}

Expand Down

0 comments on commit 57c2f7a

Please sign in to comment.