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

Add iter size hints #141

Merged
merged 1 commit into from
Jan 13, 2022
Merged

Add iter size hints #141

merged 1 commit into from
Jan 13, 2022

Conversation

saik0
Copy link
Contributor

@saik0 saik0 commented Jan 13, 2022

This is a blocker for #140 as proptest calls size_hint when generate / shrinking.

Could only implement ExactSizeIterator on the outer (Bit|Tree)Maps on 64 bit architectures to ensure the u64 value is not truncated when casting to usize.

@saik0 saik0 mentioned this pull request Jan 13, 2022
Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

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

I find this PR great, as it removes the panics everywhere. I was not even sure of why they were there. Thank you!

bors merge

}
}

impl<'a> ExactSizeIterator for Iter<'a> {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
impl<'a> ExactSizeIterator for Iter<'a> {
impl ExactSizeIterator for Iter<'_> {

Copy link
Member

Choose a reason for hiding this comment

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

Whoops, I merged it... 🤦

@bors
Copy link
Contributor

bors bot commented Jan 13, 2022

Build succeeded:

@bors bors bot merged commit dcff07b into RoaringBitmap:master Jan 13, 2022
bors bot added a commit that referenced this pull request Jan 13, 2022
142: Migrate to proptest r=Kerollmops a=saik0

Closes #140 
Depends on #141 (will not work correctly with 0b4c044)

See #140 for details

Co-authored-by: saik0 <[email protected]>
@saik0 saik0 mentioned this pull request Feb 5, 2022
not-jan pushed a commit to not-jan/roaring-rs that referenced this pull request Aug 31, 2022
141: Add iter size hints r=Kerollmops a=saik0

This is a blocker for RoaringBitmap#140 as proptest calls `size_hint` when generate / shrinking.

Could only implement ExactSizeIterator on the outer (Bit|Tree)Maps on 64 bit architectures to ensure the `u64` value is not truncated when casting to usize.

Co-authored-by: saik0 <[email protected]>
not-jan pushed a commit to not-jan/roaring-rs that referenced this pull request Aug 31, 2022
142: Migrate to proptest r=Kerollmops a=saik0

Closes RoaringBitmap#140 
Depends on RoaringBitmap#141 (will not work correctly with 0b4c044)

See RoaringBitmap#140 for details

Co-authored-by: saik0 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants