Version 0.10.2
Introduce the RoaringBitmap::remove_smallest/biggests
methods
Thanks to @shimatar0, who added those two methods. They remove the n
smallest or biggest values from a RoaringBitmap
. If n
is bigger than the cardinality of the bitmap, it clears it.
let mut rb = RoaringBitmap::from_iter([1, 5, 7, 9, 10, 15, 45]);
rb.remove_biggest(2);
assert_eq!(rb, RoaringBitmap::from_iter([1, 5, 7, 9, 10]));
rb.remove_smallest(1);
assert_eq!(rb, RoaringBitmap::from_iter([5, 7, 9, 10]));
RoaringBitmaps/Treemap
s support run containers when deserializing
Thanks in part to @josephglanville for the original deserialization code. Bitmaps and treemaps can deserialize run containers which are useful when those come from other libraries from other languages.
Note that this library supports run container operations and only converts the run containers into array or bitmap containers depending on the cardinality and will, therefore, not serialize containers into run ones either.
Create RoaringBitmap
or RoaringTreemap
from an array
Thanks to @michaelmior, you can use the From::from
trait method to construct a bitmap from an array. Building them using the FromIterator::from_iter
trait method was already possible. It is just even from convenient now.
let bitmap = RoaringBitmap::from([10]);
let treemap = RoaringTreemap::from([1,2,3]);
Bumped the MSRV to 1.65
While doing crate maintenance, I had to update different crates and bump the minimal supported Rust version to 1.65, which was released eight months ago.