Skip to content

Commit

Permalink
Implement Clone on the bitmap::Iter type
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerollmops committed Sep 2, 2024
1 parent 9e743c4 commit abfabf4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions roaring/src/bitmap/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct Container {
pub store: Store,
}

#[derive(Clone)]
pub struct Iter<'a> {
pub key: u16,
inner: store::Iter<'a>,
Expand Down
1 change: 1 addition & 0 deletions roaring/src/bitmap/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::{NonSortedIntegers, RoaringBitmap};
use alloc::vec::Vec;

/// An iterator for `RoaringBitmap`.
#[derive(Clone)]
pub struct Iter<'a> {
inner: iter::Flatten<slice::Iter<'a, Container>>,
size_hint: u64,
Expand Down
1 change: 1 addition & 0 deletions roaring/src/bitmap/store/bitmap_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ impl Display for Error {
#[cfg(feature = "std")]
impl std::error::Error for Error {}

#[derive(Clone)]
pub struct BitmapIter<B: Borrow<[u64; BITMAP_LENGTH]>> {
key: usize,
value: u64,
Expand Down
1 change: 1 addition & 0 deletions roaring/src/bitmap/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub enum Store {
Bitmap(BitmapStore),
}

#[derive(Clone)]
pub enum Iter<'a> {
Array(slice::Iter<'a, u16>),
Vec(vec::IntoIter<u16>),
Expand Down

0 comments on commit abfabf4

Please sign in to comment.