@@ -649,12 +649,12 @@ impl<I, T> CoalesceCore<I, T>
649
649
///
650
650
/// See [`.coalesce()`](../trait.Itertools.html#method.coalesce) for more information.
651
651
#[ must_use = "iterator adaptors are lazy and do nothing unless consumed" ]
652
- pub type Coalesce < I , F > = CoalesceBy < I , F > ;
652
+ pub type Coalesce < I , F > = CoalesceBy < I , F , < I as Iterator > :: Item > ;
653
653
654
- pub struct CoalesceBy < I , F >
654
+ pub struct CoalesceBy < I , F , T >
655
655
where I : Iterator
656
656
{
657
- iter : CoalesceCore < I , I :: Item > ,
657
+ iter : CoalesceCore < I , T > ,
658
658
f : F ,
659
659
}
660
660
@@ -670,16 +670,15 @@ impl<F, Item, T> CoalescePredicate<Item, T> for F
670
670
}
671
671
}
672
672
673
- impl < I : Clone , F : Clone > Clone for CoalesceBy < I , F >
673
+ impl < I : Clone , F : Clone , T : Clone > Clone for CoalesceBy < I , F , T >
674
674
where I : Iterator ,
675
- I :: Item : Clone
676
675
{
677
676
clone_fields ! ( iter, f) ;
678
677
}
679
678
680
- impl < I , F > fmt:: Debug for CoalesceBy < I , F >
679
+ impl < I , F , T > fmt:: Debug for CoalesceBy < I , F , T >
681
680
where I : Iterator + fmt:: Debug ,
682
- I :: Item : fmt:: Debug ,
681
+ T : fmt:: Debug ,
683
682
{
684
683
debug_fmt_fields ! ( CoalesceBy , iter) ;
685
684
}
@@ -697,11 +696,11 @@ pub fn coalesce<I, F>(mut iter: I, f: F) -> Coalesce<I, F>
697
696
}
698
697
}
699
698
700
- impl < I , F > Iterator for CoalesceBy < I , F >
699
+ impl < I , F , T > Iterator for CoalesceBy < I , F , T >
701
700
where I : Iterator ,
702
- F : CoalescePredicate < I :: Item , I :: Item >
701
+ F : CoalescePredicate < I :: Item , T >
703
702
{
704
- type Item = I :: Item ;
703
+ type Item = T ;
705
704
706
705
fn next ( & mut self ) -> Option < Self :: Item > {
707
706
let f = & mut self . f ;
0 commit comments