Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make BinaryHeap's Items iterator implement DoubleEnded and ExactSize #19330

Merged
merged 1 commit into from
Nov 27, 2014

Conversation

csouth3
Copy link
Contributor

@csouth3 csouth3 commented Nov 26, 2014

There's no reason that BinaryHeap's iterator can't implement DoubleEnded and ExactSize, so add these implementations.

@csouth3
Copy link
Contributor Author

csouth3 commented Nov 26, 2014

Note: This commit will need to be rebased on top of #19176 when it lands, so I'll keep an eye on that. Just thought I'd throw it out there now.

@Gankra
Copy link
Contributor

Gankra commented Nov 26, 2014

In retrospect, reverse iteration isn't a particularly semantically valid operation on a BinaryHeap. But I guess there's a partial order in there somewhere? Regardless, this is "free" to provide, and easy to remove later.

@csouth3
Copy link
Contributor Author

csouth3 commented Nov 26, 2014

It's my pleasure! Figured since you requested DoubleEnded etc. for MoveItems, I'd go back and add it for the other iterator as well since it's so simple. But it's totally fine if it gets pulled at some point!

I'll try to get this rebased as soon as the iter stabilization lands.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Nov 27, 2014
There's no reason that BinaryHeap's iterator can't implement DoubleEnded and ExactSize, so add these implementations.
@bors bors merged commit d48886c into rust-lang:master Nov 27, 2014
@csouth3 csouth3 deleted the binaryheap-iter branch November 27, 2014 06:38
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.

3 participants