-
-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
It seems the double ended iterator is not behaving as expected.
It is important to note that both back and forth work on the same range, and do not cross: iteration is over when they meet in the middle.
https://doc.rust-lang.org/std/iter/trait.DoubleEndedIterator.html
There should be two pointers one pointing to the position at the beginning and one at the end.
The code moves the one pointer instead. Next back should move the later and keep the pointer used in next untouched.
https://github.com/davidcole1340/ext-php-rs/blob/8985cb2f82ac680083b74a5f377b2fda9c8f04d4/src/types/array.rs#L688-L728
If i have [1, 2, 3, 4, 5] - next() should return 1 and next_back() 5
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working