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

Implement DoubleEndedIterator for Zip #346

Merged

Conversation

svenknobloch
Copy link
Contributor

Implements the DoubleEndedIterator trait for Zip. Based on the standard library's implementation.

@jswrenn jswrenn self-assigned this Jul 18, 2019
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 the contribution! Could you add a quickcheck test?

@@ -42,6 +43,20 @@ fn test_double_ended_zip_longest() {
assert_eq!(it.next(), None);
}

#[test]
fn test_double_ended_zip() {
Copy link
Member

Choose a reason for hiding this comment

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

Could you formulate this as a quickcheck test?

I'd like to see that for any two inputs, multizip((a, b)).collect_vec().rev() is equal to (something like) multizip((a, b)).rfold(Vec::new(), |vec, e| { vec.push(e); vec })

@jswrenn jswrenn force-pushed the feature/zip-double-ended-iterator branch from c2f4530 to da719ad Compare September 4, 2020 22:28
@jswrenn
Copy link
Member

jswrenn commented Sep 4, 2020

bors r+

@jswrenn jswrenn added this to the next milestone Sep 4, 2020
@bors
Copy link
Contributor

bors bot commented Sep 4, 2020

Build succeeded:

@bors bors bot merged commit 180c4e0 into rust-itertools:master Sep 4, 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