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

Our non-lazy adaptors #939

Merged

Conversation

Philippe-Cholet
Copy link
Member

Fixes #791

Itertools::{kmerge, kmerge_by, tuple_combinations} are neither lazy nor eager. But they must be used since not doing so does almost nothing (and it would be suspicious code to me).
I therefore update the message of the must_use attributes and the laziness tests.

Unless we are willing to roughly wrap those in a LazyInit type (see #791 (comment)) that would probably slow down iteration ("Is it initialized?" each time next is called), I don't see an alternative.

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.

Good catch. Could you update #937 after this is merged? I'll cut a release today.

@jswrenn jswrenn added this pull request to the merge queue May 16, 2024
@Philippe-Cholet Philippe-Cholet added this to the 0.13.0 milestone May 16, 2024
Merged via the queue into rust-itertools:master with commit d7c99d5 May 16, 2024
11 checks passed
@Philippe-Cholet Philippe-Cholet deleted the non-lazy-but-must-be-used branch May 16, 2024 14:52
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.

Laziness of our iterators
2 participants