Skip to content

Fuse iterators in InterleaveShortest - #872

Open
phimuemue wants to merge 2 commits into
rust-itertools:masterfrom
phimuemue:fuse_interleave_shortest
Open

Fuse iterators in InterleaveShortest#872
phimuemue wants to merge 2 commits into
rust-itertools:masterfrom
phimuemue:fuse_interleave_shortest

Conversation

@phimuemue

@phimuemue phimuemue commented Feb 8, 2024

Copy link
Copy Markdown
Member

In my book, InterleaveShortest should not produce more items than Interleave, but so far it did for unfused source iterators.

This PR brings InterleaveShortest in line with Interleave. The documentation already (incorrectly) stated that InterleaveShortest is fused.

Related to #533.

This brings InterleaveShortest in line with Interleave.
The documentation already (incorrectly) stated that InterleaveShortest is fused.
@codecov

codecov Bot commented Feb 8, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.93%. Comparing base (6814180) to head (fdecb71).
⚠️ Report is 211 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #872      +/-   ##
==========================================
- Coverage   94.38%   93.93%   -0.46%     
==========================================
  Files          48       52       +4     
  Lines        6665     6679      +14     
==========================================
- Hits         6291     6274      -17     
- Misses        374      405      +31     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Philippe-Cholet

Philippe-Cholet commented Feb 8, 2024

Copy link
Copy Markdown
Member

I started an investigation ("blame" in the web pages of our code is even more powerful than I thought (for each line, we can have navigate its history)):
In #31 it was added and was actually fused.
Then the commit that is interesting us here is beaf395 (by bluss, he missed one comment in this "unfuse" commit that you found).

@phimuemue

Copy link
Copy Markdown
Member Author

I started an investigation ("blame" in the web pages of our code is even more powerful than I thought (for each line, we can have navigate its history)): In #31 it was added and was actually fused. Then the commit that is interesting us here is beaf395 (by bluss, he missed one comment in this "unfuse" commit that you found).

I'm fine with either unfused or fused, but I'd vote for uniform behavior. Not sure if we have a general guideline regarding fusedness, though.

@Philippe-Cholet

Copy link
Copy Markdown
Member

I'm fine with either unfused or fused, but I'd vote for uniform behavior. Not sure if we have a general guideline regarding fusedness, though.

I agree.
I think it would be great to have a clear guideline about fusedness. And maybe better tests about (un)fusedness. I'm not sure all the iterators behave correctly in that regard (and have correct documentation).
It's not very high on my TODO list though as I'd rather triage/complete old issues/PRs and work on fold specializations and maybe_/Try to eventually move to use const-generics.

@Philippe-Cholet

Copy link
Copy Markdown
Member

I'm gonna make an issue about fusedness to see opened issues and PRs related to it, clarify the situation (like make a guideline) and eventually make a TODO list about all this.

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.

2 participants