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 Jun 16, 2019
1 parent 79bdcf0 commit 4b2f48b
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;

/// An iterator over a incomplete tuple.
///
Expand Down Expand Up @@ -183,8 +186,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 @@ -197,7 +200,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 4b2f48b

Please sign in to comment.