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
Implement Itertools::multiunzip
#565
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi there, thanks for this! I would be willing to see this functionality in itertools
.
I really like how you mimic unzip
's inner workings as far as possible, and document where this is not yet possible.
lgtm. @jswrenn If there are no objections, I'd consider merging, as this is a counterpart to the existing |
Thanks for this. bors r+ |
Build succeeded: |
Simple implementation of Iterator::unzip but for tuples of sizes 0-12.
This requires adding a new public trait to be able to express the dependency between the iterator item tuple to the collection output tuple. But given that a
multiunzip
function is added to the Itertools trait theMultiUnzip
trait does not have to be imported to make use of this.Another option would be a macro but that would require giving it some extra syntax to declare the arity/return type which seems suboptimal, while this approach just works as a method call akin to std's iterator unzip.
Closes #362