fn traverse<T, I>(self, it: I) -> Vec<T>
        where I: ExactSizeIterator<Item = T> + DoubleEndedIterator<Item = T>
    {
        match self {
            Direction::Forward => it.collect(),
            Direction::Backward => it.rev().collect(),
        }
    }
/// traverse the iterator backwords or forwards based on the direction
/// There is surely a way to return an iterator without just making a new vector,
/// but I can't figure it out
traverse the iterator backwords or forwards based on the direction
There is surely a way to return an iterator without just making a new vector,
but I can't figure it out
traverse the iterator backwords or forwards based on the direction There is surely a way to return an iterator without just making a new vector but I can ' t figure it out
fn traverse<T, I>(self, it: I) -> Vec<T>
        where I: ExactSizeIterator<Item = T> + DoubleEndedIterator<Item = T>
    {
        match self {
            Direction::Forward => it.collect(),
            Direction::Backward => it.rev().collect(),
        }
    }
fn traverse < T , I > ( self , it : I ) -> Vec < T > where I : ExactSizeIterator < Item = T > + DoubleEndedIterator < Item = T > { match self { Direction :: Forward => it . collect ( ) , Direction :: Backward => it . rev ( ) . collect ( ) , } }
traverse the iterator backwords or forwards based on the direction
There is surely a way to return an iterator without just making a new vector,
but I can't figure it out
traverse the iterator backwords or forwards based on the direction There is surely a way to return an iterator without just making a new vector but I can ' t figure it out
self
it
I