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

Fix #657 #683

Merged
merged 3 commits into from Jun 14, 2023
Merged

Fix #657 #683

merged 3 commits into from Jun 14, 2023

Conversation

Easyoakland
Copy link
Contributor

This fix seemed very simple. Maybe I'm missing something?
Fixes #657.

@jswrenn jswrenn added this to the next milestone Mar 23, 2023
Comment on lines 855 to 863
for (i, chunk) in grouper_clone.into_iter().enumerate() {
match i {
0 => it::assert_equal(chunk, &[0, 0, 0]),
1 => it::assert_equal(chunk, &[1, 1, 0]),
2 => it::assert_equal(chunk, &[0, 2, 2]),
3 => it::assert_equal(chunk, &[3, 3]),
_ => unreachable!(),
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Let's avoid the duplication here with the above code block, and make it more explicit that you're testing that these produce the same output.

You can achieve this by doing something like:

for (i, (chunk, cloned_chunk)) in grouper.into_iter(grouper_clone).zip().enumerate() {
    assert_eq!(chunk, cloned_chunk);
    match i { /* the match branches */ }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d608283

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.

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 14, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

  • bors build finished

@bors bors bot merged commit c17ef69 into rust-itertools:master Jun 14, 2023
1 check passed
@Easyoakland Easyoakland deleted the Fix_#657 branch July 17, 2023 19:23
@jswrenn jswrenn modified the milestones: next, v11.0.0 Nov 13, 2023
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.

Clonable Chunks iterator?
2 participants