core: implement FusedIterator for StepBy - #159963
Conversation
|
r? @jhpratt rustbot has assigned @jhpratt. Use Why was this reviewer chosen?The reviewer was selected based on:
|
741bdbd to
8cf58ce
Compare
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
Signed-off-by: 林晨 (Leo Cheng) <leo-cheng@vip.qq.com>
8cf58ce to
0485003
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
I think this might be a duplicate of #156999? |
|
Thanks @madsmtm - you're right, #156999 predates this and implements the same ACP (rust-lang/libs-team#757). I wasn't aware of it when I opened this one. This PR has completed the FCP and carries |
Implements the accepted ACP rust-lang/libs-team#757.
StepByyields no more items once its underlying iterator is exhausted, so it is fused whenever the underlying iterator is fused.StepBywas added in 1.28.0, just after the batch ofFusedIteratorimpls stabilized in 1.26.0 (Map,Skip,Take,Enumerate, ...), so it was left out.This is insta-stable, matching the sibling adapter impls, so it needs a libs-api FCP.
Motivation from the ACP: crates with traits refined on top of
FusedIterator(e.g.range-set-blaze'sSortedStarts) cannot coverStepBytoday, even though it would always be valid.A
test_step_by_fusedregression test is added.