diff --git a/croaring/Cargo.toml b/croaring/Cargo.toml index 2eacddc..e4c10e7 100644 --- a/croaring/Cargo.toml +++ b/croaring/Cargo.toml @@ -25,7 +25,7 @@ roaring = "0.10" criterion = { version = "0.5", features = ["html_reports"] } [dependencies] -ffi = { package = "croaring-sys", path = "../croaring-sys", version = "~4.1.1" } +ffi = { package = "croaring-sys", path = "../croaring-sys", version = "~4.1.2" } [[bench]] name = "benches" diff --git a/croaring/src/bitmap/mod.rs b/croaring/src/bitmap/mod.rs index 417c04a..b38fc98 100644 --- a/croaring/src/bitmap/mod.rs +++ b/croaring/src/bitmap/mod.rs @@ -67,7 +67,7 @@ use core::marker::PhantomData; // &BitmapView and &Bitmap #[repr(transparent)] pub struct Bitmap { - bitmap: ffi::roaring_bitmap_t, + pub(crate) bitmap: ffi::roaring_bitmap_t, } unsafe impl Sync for Bitmap {} diff --git a/croaring/src/bitmap64/ops.rs b/croaring/src/bitmap64/ops.rs index dc60609..4a22403 100644 --- a/croaring/src/bitmap64/ops.rs +++ b/croaring/src/bitmap64/ops.rs @@ -1,4 +1,4 @@ -use crate::Bitmap64; +use crate::{Bitmap, Bitmap64}; use core::fmt; use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Sub, SubAssign}; use ffi::roaring64_bitmap_copy; @@ -45,6 +45,12 @@ impl From<&'_ [u64]> for Bitmap64 { } } +impl From for Bitmap64 { + fn from(mut value: Bitmap) -> Self { + unsafe { Self::take_heap(ffi::roaring64_bitmap_move_from_roaring32(&mut value.bitmap)) } + } +} + impl From<[u64; N]> for Bitmap64 { #[inline] #[doc(alias = "roaring64_bitmap_of_ptr")]