Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework the insert/remove_range functions with RangeBounds #92

Merged
merged 13 commits into from
Oct 20, 2021

Conversation

Kerollmops
Copy link
Member

@Kerollmops Kerollmops commented Mar 20, 2021

This PR fixes #5 by reworking the Bitmap::insert_range and Bitmap::remove_range functions to accept any type that implement the RangeBounds trait. Note that it is a breaking change and therefore involves bumping the crate version carefully.

The current version of all these functions was accepting an exclusive Range<u64> to let user define all possible integers in the range 0 to u32::MAX, but as it is an exclusive range, a u64 was required.

@josephglanville, could you please take a look at this PR? When you got time 😃

@Kerollmops Kerollmops changed the title Rework the insert/remove_range function with RangeBounds Rework the insert/remove_range functions with RangeBounds Mar 20, 2021
Copy link

@Urhengulas Urhengulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brief hello from this-week-in-rust 👋🏾

src/bitmap/inherent.rs Outdated Show resolved Hide resolved
src/bitmap/inherent.rs Outdated Show resolved Hide resolved
@Kerollmops Kerollmops force-pushed the insert-remove-range-bounds branch from 14376a0 to b27dc3c Compare October 18, 2021 15:00
@Kerollmops
Copy link
Member Author

Hey @oliverdding,

Could you please do a last review before I merge that? It is safe enough as you and I added more tests, but can you take a look at the files, please? Just to make sure my rebasing didn't break anything?

@oliverdding
Copy link
Contributor

Hi @Kerollmops

It's my pleasure.

Copy link
Contributor

@oliverdding oliverdding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one thing left to be changed, and two for discussion.

src/bitmap/inherent.rs Outdated Show resolved Hide resolved
src/treemap/inherent.rs Outdated Show resolved Hide resolved
src/bitmap/store.rs Outdated Show resolved Hide resolved
@Kerollmops
Copy link
Member Author

Thank you very much for your review @oliverdding, I have applied your advice and will merged just after your last review 🫖

@Kerollmops Kerollmops added the breaking This change will require a bump of the minor or major version. label Oct 20, 2021
@Kerollmops
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Oct 20, 2021
@bors
Copy link
Contributor

bors bot commented Oct 20, 2021

try

Build failed:

@Kerollmops
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Oct 20, 2021
@bors
Copy link
Contributor

bors bot commented Oct 20, 2021

try

Build failed:

@Kerollmops
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Oct 20, 2021
@bors
Copy link
Contributor

bors bot commented Oct 20, 2021

try

Build succeeded:

Copy link
Contributor

@oliverdding oliverdding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems nice to me :)

@Kerollmops
Copy link
Member Author

Thank you for the last review!
bors merge

@bors
Copy link
Contributor

bors bot commented Oct 20, 2021

Build succeeded:

@bors bors bot merged commit 719b7aa into master Oct 20, 2021
@bors bors bot deleted the insert-remove-range-bounds branch October 20, 2021 20:34
not-jan pushed a commit to not-jan/roaring-rs that referenced this pull request Aug 31, 2022
92: Rework the insert/remove_range functions with RangeBounds r=Kerollmops a=Kerollmops

This PR fixes RoaringBitmap#5 by reworking the `Bitmap::insert_range` and `Bitmap::remove_range` functions to accept any type that implement [the `RangeBounds` trait](https://doc.rust-lang.org/nightly/core/ops/trait.RangeBounds.html). Note that it is a breaking change and therefore involves bumping the crate version carefully.

The current version of all these functions was accepting an [exclusive `Range<u64>`](https://doc.rust-lang.org/nightly/core/ops/struct.Range.html) to let user define all possible integers in the range `0` to `u32::MAX`, but as it is an exclusive range, a `u64` was required.

`@josephglanville,` could you please take a look at this PR? When you got time 😃

Co-authored-by: Clément Renault <[email protected]>
Co-authored-by: oliverdding <[email protected]>
Co-authored-by: Kerollmops <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change will require a bump of the minor or major version. enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Bounded Iterator
4 participants