gapbuffer
gapbuffer copied to clipboard
Implement reversible "walk" iterator
See also #11.
We may not need both this PR and #11, but with the lack of normal slicing behavior the usual DoubleEndedIterator approach to reverse iterators doesn't quite work. "Walk backwards from n" can't be implemented as buf.slice_to(n).iter().rev(), so this is a simple alternative. (buf.iter().skip(n).rev() also doesn't quite work, since that will have the iterator work from the end of the buffer to n, rather than n to start)
buf.walk_from(n).reverse()