Open yoshuawuyts opened 6 years ago
Some cases to consider:
.prev()
left-child
right-child
left-span
right-span
I'm thinking we should perhaps return the Option type more often in both FlatTree and the Iterator structs.
Option
FlatTree
Iterator
Speak of the devil. Ran into the .prev() issue.
@yoshuawuyts But we're checking index in .prev()
https://github.com/datrs/flat-tree/blob/30f6a0791813fb3fb87b4024b1136e5c13d6e1b0/src/iterator.rs#L65-L67
apparently it can slip through and still crash. Error originates on Iterator, line 69 :disappointed:
Some cases to consider:
.prev()
on the iterator while at the left nodesleft-child
/right-child
of a leaf nodeleft-span
/right-span
of a leaf nodeI'm thinking we should perhaps return the
Option
type more often in bothFlatTree
and theIterator
structs.