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 Itertools.counts_by. #515

Merged
merged 6 commits into from Jan 16, 2021
Merged

Conversation

mmirate
Copy link
Contributor

@mmirate mmirate commented Jan 10, 2021

This is a fairly straightforward extension of the existing "counts" method.

@SkiFire13
Copy link
Contributor

Isn't this exactly the same as calling Iterator::map followed by Itertools::counts?

@mmirate
Copy link
Contributor Author

mmirate commented Jan 10, 2021

Yes.

@SkiFire13
Copy link
Contributor

Then I guess you could reuse them to avoid duplicating logic.

at the cost of greater reliance on compiler optimizations.
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@jswrenn jswrenn added this to the next milestone Jan 14, 2021
src/lib.rs Outdated Show resolved Hide resolved
Co-authored-by: Jack Wrenn <me@jswrenn.com>
src/lib.rs Show resolved Hide resolved
Copy link
Member

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

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

Thanks for this!

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 16, 2021

Build succeeded:

@bors bors bot merged commit 4d317f7 into rust-itertools:master Jan 16, 2021
@mmirate mmirate deleted the mmirate-patch-2 branch January 18, 2021 05:51
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.

None yet

3 participants