billyrieger / bimap-rs

Generic bijective maps in Rust
Apache License 2.0
129 stars 26 forks source link

impl DoubleEndedIterator for IntoIter #35

Closed Skarlett closed 1 year ago

Skarlett commented 2 years ago

I noticed that DoubleEndedIterator could be implemented for the internal IntoIter structure. This would add on methods such as rev() next_back()

I'll likely make a fork with the appropriate modifications, and open up a pull request if all looks good to you.

Also, could you note somewhere in the documentation if ordering is preserved during iteration, thanks.

billyrieger commented 2 years ago

Yes, I'd be happy to review a pull request with those changes. The iteration order is preserved for BiBTreeMap but not for BiHashMap. I can make a note of that in the module documentation.

flokli commented 1 year ago

@Skarlett did you get around to open that PR? I'm currently trying to use the *_range methods to find the next neighbor, which also only works into the increasing direction.

Skarlett commented 1 year ago

@Skarlett did you get around to open that PR? I'm currently trying to use the *_range methods to find the next neighbor, which also only works into the increasing direction.

Ah, sorry. I've been busy under a new umbrella and haven't gotten to writing it.

GrigorenkoPV commented 1 year ago

Isn't it already implemented? https://github.com/billyrieger/bimap-rs/blob/3dca651620845a939ee9e5393c0a8fe9fe0a1656/src/btree.rs#L735

flokli commented 1 year ago

Yes, you were right. Sorry for the noise. Looks like this issue can be closed.