Skip to content

Implement FusedIterator for our iterators. - #116

Open
ChrisJr404 wants to merge 1 commit into
orium:mainfrom
ChrisJr404:fused-iterator
Open

Implement FusedIterator for our iterators.#116
ChrisJr404 wants to merge 1 commit into
orium:mainfrom
ChrisJr404:fused-iterator

Conversation

@ChrisJr404

Copy link
Copy Markdown

Closes #16.

This implements FusedIterator for all the collection iterators. FusedIterator has been stable for a long time now, so the "when it stabilizes" caveat no longer applies.

Once each of the base iterators (IterPtr, the queue's LazilyReversedListIter, and the red-black tree's RangeIterPtr) returns None it keeps returning None, so the marker is sound. The public Iter, IterKeys, IterValues and RangeIter types are core::iter::Map wrappers over those base iterators, so they pick up FusedIterator automatically once the base ones have it.

I added a small "keeps returning None" test per collection, plus assert_impl_all! checks on the public iterator types so the trait stays wired up.

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.

Implement FusedIterator for our iterators (when it stabilizes)

1 participant