Skip to content

Lifted intersperse and intersperse_with Fused transformation and updated documentation + tests#153880

Open
asder8215 wants to merge 2 commits intorust-lang:mainfrom
asder8215:intersperse_nonfused
Open

Lifted intersperse and intersperse_with Fused transformation and updated documentation + tests#153880
asder8215 wants to merge 2 commits intorust-lang:mainfrom
asder8215:intersperse_nonfused

Conversation

@asder8215
Copy link
Contributor

@asder8215 asder8215 commented Mar 14, 2026

This PR once again builds on top of #152855. From the discussion in #152855, libs team came to the conclusion that intersperse/intersperse_with shouldn't transform the given iterator to a fused iterator always and a separator should be emitted between Some(_) items for non fused iterators (particularly just right before the subsequent Some(_)).

On top of the change Zakarumych added in the PR, I lifted the FusedIterator trait and transformation of the inner iter for Intersperse/IntersperseWith, so that we can display this behavior. I've adjusted the documentation and tests accordingly to reflect this change as well.

r? @jhpratt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 14, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 14, 2026

jhpratt is not on the review rotation at the moment.
They may take a while to respond.

@asder8215
Copy link
Contributor Author

Oh didn't realize jhpratt is off rotation.

Then, r? libs

@rustbot rustbot assigned Mark-Simulacrum and unassigned jhpratt Mar 14, 2026
@rust-log-analyzer

This comment has been minimized.

@asder8215 asder8215 force-pushed the intersperse_nonfused branch from 3d90677 to 8361a97 Compare March 14, 2026 17:55
@asder8215 asder8215 force-pushed the intersperse_nonfused branch from 8361a97 to 800d9ea Compare March 14, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants