mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-06 01:38:35 +00:00
core: implement FusedIterator for StepBy Implements the accepted ACP rust-lang/libs-team#757. `StepBy` yields no more items once its underlying iterator is exhausted, so it is fused whenever the underlying iterator is fused. `StepBy` was added in 1.28.0, just after the batch of `FusedIterator` impls stabilized in 1.26.0 (`Map`, `Skip`, `Take`, `Enumerate`, ...), so it was left out. ```rust impl<I: FusedIterator> FusedIterator for StepBy<I> {} ``` 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`'s `SortedStarts`) cannot cover `StepBy` today, even though it would always be valid. A `test_step_by_fused` regression test is added.