Skip to content

Conversation

@Boog900
Copy link
Contributor

@Boog900 Boog900 commented Nov 18, 2025

Pull Request

What does this PR do?

From what I can tell in the last method for the iterators we are checking if the current key we are pointing at is equal to the last key so that if we have already gone through the iterator we return None. This doesn't work for dup tables though as the values may be different even if the key is the same (I added a test case that fails).

Although this PR removes this entirely, always returning a value for last, even if the iterator has already returned None from next. The main reason is this simpler and there is no requirement that once an iterator returns None that it wont return Some again: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.next

Sorry if I missed something that makes this change invalid though!

Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Boog900 for this PR, it's a breaking change, and would it be possible to document the last method about this specific behavior, please?

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.

2 participants