Skip to content

Commit

Permalink
fixup! Add circular_tuple_windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-bassett committed Mar 13, 2020
1 parent 02d5669 commit db42251
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/tuple_impl.rs
@@ -1,6 +1,9 @@
//! Some iterator that produces tuples

use std::iter::Fuse;
use std::iter::Take;
use std::iter::Cycle;
use std::marker::PhantomData;

// `HomogeneousTuple` is a public facade for `TupleCollect`, allowing
// tuple-related methods to be used by clients in generic contexts, while
Expand Down Expand Up @@ -196,8 +199,8 @@ pub struct CircularTupleWindows<I, T: Clone>
where I: Iterator<Item = T::Item> + Clone,
T: TupleCollect + Clone
{
iter: std::iter::Take<TupleWindows<std::iter::Cycle<I>, T>>,
phantom_data: std::marker::PhantomData<T>
iter: Take<TupleWindows<Cycle<I>, T>>,
phantom_data: PhantomData<T>
}

pub fn circular_tuple_windows<I, T>(iter: I) -> CircularTupleWindows<I, T>
Expand All @@ -210,7 +213,7 @@ pub fn circular_tuple_windows<I, T>(iter: I) -> CircularTupleWindows<I, T>

CircularTupleWindows {
iter: iter,
phantom_data: std::marker::PhantomData{}
phantom_data: PhantomData{}
}
}

Expand Down

0 comments on commit db42251

Please sign in to comment.