New week, new Rust! What are you folks up to?
I found a simplification for my BTreeMap iterators, fwd_leaf and bck_leaf are no longer Option, which removes quite a bit of clutter from the code.
/// Iterator returned by [`BTreeMap::range_mut`].
#[derive(Debug, Default)]
pub struct RangeMut<'a, K, V> {
/* There are two iterations going on to implement DoubleEndedIterator.
fwd_leaf and fwd_stk are initially used for forward (next) iteration,
once they are exhausted, key-value pairs and child trees are "stolen" from
bck_stk and bck_leaf which are (conversely) initially used for next_back iteration.
*/
fwd_leaf: IterMutPairVec<'a, K, V>,
bck_leaf: IterMutPairVec<'a, K, V>,
fwd_stk: StkVec<StkMut<'a, K, V>>,
bck_stk: StkVec<StkMut<'a, K, V>>,
}
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.