Skip to content

Conversation

Philippe-Cholet
Copy link
Member

@Philippe-Cholet Philippe-Cholet commented Nov 3, 2023

Related to #792

To make the Permutations adaptor lazy, the operation "prefill the lazy buffer" is now done when handling the initial Start state rather than at definition.

To make the `Permutations` adaptor lazy, the operation "prefill the lazy buffer" is now done when handling the initial `Start` state rather than at definition.
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.

This looks great! Can you just add a test to prevent us regressing on this?

For instance, create an iterator whose next call panics, then create a Permutations around it; doing so shouldn't panic.

@Philippe-Cholet
Copy link
Member Author

Philippe-Cholet commented Nov 3, 2023

@jswrenn That's what #792 is for. It helped me make a list of iterators that are not lazy yet and will ensure we don't regress on that front once merged. Make a test now would be soon a duplicate.

@jswrenn jswrenn added this pull request to the merge queue Nov 3, 2023
@jswrenn jswrenn added this to the next milestone Nov 3, 2023
Merged via the queue into rust-itertools:master with commit 04baddb Nov 3, 2023
@Philippe-Cholet Philippe-Cholet deleted the permutations-laziness branch November 3, 2023 20:12
@jswrenn jswrenn mentioned this pull request Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants