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

Remove bitvec dependency and other bit field changes #525

Merged
merged 6 commits into from
Jun 30, 2020

Conversation

timvermeulen
Copy link
Contributor

The main changes:

  • remove the bitvec dependency as well as the RlePlus::{encode, decode} methods because we no longer need them
  • add tests for BitReader and BitWriter, they were already tested through general bit field tests but now it's much more thorough
  • add rleplus! and bitfield! macros to easily create bit fields for testing purposes (which loosely replace the bitvec! macro)

Minor stuff:

  • improve RlePlus's Debug implementation
  • fix a bug in RlePlus's PartialEq implementation
  • add FromIterator<bool> and FromIterator<usize> implementations to RlePlus and BitField
  • simplify BitWriter::finish

@@ -134,7 +137,7 @@ impl BitField {
/// Returns an iterator over the indices of the bit field's set bits if the number
/// of set bits in the bit field does not exceed `max`. Returns an error otherwise.
pub fn bounded_iter(&self, max: usize) -> Result<impl Iterator<Item = usize> + '_> {
if max <= self.len() {
if self.len() <= max {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you!

@timvermeulen timvermeulen merged commit 2d88d06 into main Jun 30, 2020
@timvermeulen timvermeulen deleted the tim/remove-bitvec branch June 30, 2020 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants