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

Implemented Binary and Display traits for FixedBitSet. #39

Merged
merged 4 commits into from Apr 15, 2020
Merged

Implemented Binary and Display traits for FixedBitSet. #39

merged 4 commits into from Apr 15, 2020

Conversation

Dolphindalt
Copy link

Providing some implementation for #34. Need feedback.

src/lib.rs Outdated
};

for block in self.data.iter().rev() {
display_data = display_data.add(&format!("{:b}", block));
Copy link
Member

Choose a reason for hiding this comment

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

nice. I'd suggest that we just write this piece by piece instead of creating an intermediate String.

src/lib.rs Outdated
@@ -356,6 +360,32 @@ impl FixedBitSet
}
}

#[cfg(feature = "std")]
Copy link
Member

Choose a reason for hiding this comment

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

These don't depend on the std feature and will work fine with core, in fact. That's just a smaller thing.

Copy link
Author

Choose a reason for hiding this comment

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

I should remove it though if it is true. On it.

@bluss
Copy link
Member

bluss commented Apr 15, 2020

Looks good

@bluss
Copy link
Member

bluss commented Apr 15, 2020

Cool, thanks!

Let's be open to tweaks to the format in the future. Maybe _ separators every 16 or 32 bits would be good to keep it readable.

@bluss bluss merged commit 3f67eb6 into petgraph:master Apr 15, 2020
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

2 participants