Skip to content

Commit 31a3117

Browse files
committed
Fix bounds of impl FusedIterator for FlatZipMap.
`FlatZipMap` does not behave as a fused iterator when the outer iterator is not fused. This is arguably a semver breaking change, but `FlatZipMap` cannot be constructed with user-provided types and is `#[doc(hidden)]`. Also changed the `Clone` bounds to use associated type bound syntax. This is within our MSRV of 1.80.0 because it was added in 1.79.0.
1 parent 0a0c196 commit 31a3117

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/iteration.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ where
113113

114114
impl<I, J, O> Iterator for FlatZipMap<I, J, O>
115115
where
116-
I: Iterator,
117-
I::Item: Clone,
116+
I: Iterator<Item: Clone>,
118117
J: Iterator,
119118
{
120119
type Item = O;
@@ -143,8 +142,9 @@ where
143142

144143
impl<I, J, O> iter::FusedIterator for FlatZipMap<I, J, O>
145144
where
146-
I: Iterator,
147-
I::Item: Clone,
148-
J: Iterator,
145+
I: iter::FusedIterator<Item: Clone>,
146+
// This bound is not necessary in the current implementation,
147+
// but there isn’t any point to not requiring it.
148+
J: iter::FusedIterator,
149149
{
150150
}

0 commit comments

Comments
 (0)