Skip to content

implement DoubleEndedIterator for ranges + implement more iterator methods#589

Open
Freax13 wants to merge 10 commits into
masterfrom
feature/double-ended-iter
Open

implement DoubleEndedIterator for ranges + implement more iterator methods#589
Freax13 wants to merge 10 commits into
masterfrom
feature/double-ended-iter

Conversation

@Freax13
Copy link
Copy Markdown
Member

@Freax13 Freax13 commented May 17, 2026

This PR implements DoubleEndedIterator for DoubleEndedIterator for PageRange, PageRangeInclusive, PhysFrameRange, and PhysFrameRangeInclusive. This PR also implements nth, nth_back, and size_hint for the range types.

For my use case, I primarily needed an efficient (O(1)) implementation of PhysFrameRange::nth_back and since I was already working on that, I figured I might as well add implementations for the other range types as well.

Implementing the panicking behavior for PageRange/PageRangeInclusive was a bit annoying, so I added kani proofs to make sure the implementations behave correctly for all inputs.

@Freax13 Freax13 force-pushed the feature/double-ended-iter branch from 98fbf89 to 2700117 Compare May 17, 2026 13:39
@Freax13 Freax13 requested review from josephlr and phil-opp May 17, 2026 13:42
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.

1 participant