Skip to content

Commit 321a6c8

Browse files
committed
Remove the lifetime requirements on Flatten impls
1 parent 38cbe94 commit 321a6c8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,12 +1279,12 @@ pub struct Flatten<I> {
12791279
first: bool,
12801280
}
12811281

1282-
impl<I, J> StreamingIterator for Flatten<I>
1282+
impl<I> StreamingIterator for Flatten<I>
12831283
where
1284-
I: StreamingIteratorMut<Item = J>,
1285-
for<'a> J: StreamingIterator + 'a,
1284+
I: StreamingIteratorMut,
1285+
I::Item: StreamingIterator,
12861286
{
1287-
type Item = J::Item;
1287+
type Item = <I::Item as StreamingIterator>::Item;
12881288

12891289
#[inline]
12901290
fn advance(&mut self) {
@@ -1311,7 +1311,7 @@ where
13111311

13121312
#[inline]
13131313
fn get(&self) -> Option<&Self::Item> {
1314-
self.iter.get().and_then(|iter| iter.get())
1314+
self.iter.get().and_then(I::Item::get)
13151315
}
13161316

13171317
#[inline]
@@ -1325,14 +1325,14 @@ where
13251325
}
13261326
}
13271327

1328-
impl<I, J> StreamingIteratorMut for Flatten<I>
1328+
impl<I> StreamingIteratorMut for Flatten<I>
13291329
where
1330-
I: StreamingIteratorMut<Item = J>,
1331-
for<'a> J: StreamingIteratorMut + 'a,
1330+
I: StreamingIteratorMut,
1331+
I::Item: StreamingIteratorMut,
13321332
{
13331333
#[inline]
13341334
fn get_mut(&mut self) -> Option<&mut Self::Item> {
1335-
self.iter.get_mut().and_then(J::get_mut)
1335+
self.iter.get_mut().and_then(I::Item::get_mut)
13361336
}
13371337

13381338
#[inline]

0 commit comments

Comments
 (0)