Skip to content

Our non-lazy adaptors#939

Merged
jswrenn merged 2 commits intorust-itertools:masterfrom
Philippe-Cholet:non-lazy-but-must-be-used
May 16, 2024
Merged

Our non-lazy adaptors#939
jswrenn merged 2 commits intorust-itertools:masterfrom
Philippe-Cholet:non-lazy-but-must-be-used

Conversation

@Philippe-Cholet
Copy link
Copy Markdown
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
Copy Markdown
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
@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