Skip to content

Conversation

@phimuemue
Copy link
Member

@phimuemue phimuemue commented Jan 3, 2026

This is a consolidated version of @Takashiidobe's #1079. Thanks, @Takashiidobe, for your effort.

  • Test next, next_back explicitly: Simulate pad_usings result with a Vec and assert that they behave the same wrt next/next_back.

  • Fix: Store elements_from_next and elements_from_next_back.

    The story is: total_consumed = elements_from_next + elements_from_next_back. If total_consumed >= elements_required, we can be sure that we only need to touch iter (and not filler). See Fix pad_using bug producing items when it shouldn't #1079 for more discussion.

    For simplicity, only implement next, next_back and size_hint for now.

@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1082      +/-   ##
==========================================
- Coverage   94.38%   93.68%   -0.70%     
==========================================
  Files          48       50       +2     
  Lines        6665     6322     -343     
==========================================
- Hits         6291     5923     -368     
- Misses        374      399      +25     

☔ View full report in Codecov by Sentry.
📢 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.

@phimuemue phimuemue changed the title Pad using Fix PadUsing::next_back Jan 3, 2026
@phimuemue
Copy link
Member Author

Hi @jswrenn, gentle nudge about this.

If it helps, you can consider this reviewed.

I did not/do not know how I could take @Takashiidobe's original PR and rebase it to this one. And afaik I cannot just push to this repo.

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.

Thanks for the nudge, and sorry for the absence; I've been ramping up in a new day job. This looks fantastic! Can you just add Fixes: #1065 to the commit message?

…ements_from_next_back

Remove fold/rfold: Correctness is more important than performance.
Maybe we can come back and re-implement them later.

Fixes: rust-itertools#1065
@phimuemue
Copy link
Member Author

Thanks for the nudge, and sorry for the absence; I've been ramping up in a new day job.

Nevermind. Congrats on the new job.

Can you just add Fixes: #1065 to the commit message?

Done.

Sidenote: Should we publish a new version soon? Would simplify CI (currently always complains about semver-checks).

@phimuemue phimuemue added this pull request to the merge queue Jan 12, 2026
Merged via the queue into rust-itertools:master with commit 6c2e8f6 Jan 12, 2026
12 of 14 checks passed
@phimuemue phimuemue deleted the pad_using branch January 12, 2026 19:56
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.

3 participants