Skip to content

Commit 58cf57c

Browse files
LorenzSchuelercuviper
authored andcommitted
get rid of PhantomData
1 parent 3a64d5c commit 58cf57c

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/lib.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#![warn(missing_docs)]
4141
#![cfg_attr(not(feature = "std"), no_std)]
4242

43-
use core::{cmp, marker::PhantomData};
43+
use core::cmp;
4444

4545
mod sources;
4646
pub use crate::sources::{convert, Convert};
@@ -595,15 +595,12 @@ pub trait StreamingIteratorMut: StreamingIterator {
595595

596596
/// Creates an iterator which flattens nested streaming iterators.
597597
#[inline]
598-
fn flatten(self) -> Flatten<Self, Self::Item>
598+
fn flatten(self) -> Flatten<Self>
599599
where
600600
Self: Sized,
601601
Self::Item: StreamingIterator + Sized,
602602
{
603-
Flatten {
604-
iter: self,
605-
_inner: PhantomData,
606-
}
603+
Flatten { iter: self }
607604
}
608605
}
609606

@@ -1274,15 +1271,14 @@ where
12741271

12751272
/// A streaming iterator that flattens nested streaming iterators.
12761273
#[derive(Debug)]
1277-
pub struct Flatten<I, J> {
1274+
pub struct Flatten<I> {
12781275
iter: I,
1279-
_inner: PhantomData<J>,
12801276
}
12811277

1282-
impl<I, J> StreamingIterator for Flatten<I, J>
1278+
impl<I, J> StreamingIterator for Flatten<I>
12831279
where
12841280
I: StreamingIteratorMut<Item = J>,
1285-
J: StreamingIterator,
1281+
for<'a> J: StreamingIterator + 'a,
12861282
{
12871283
type Item = J::Item;
12881284

@@ -1316,10 +1312,10 @@ where
13161312
}
13171313
}
13181314

1319-
impl<I, J> StreamingIteratorMut for Flatten<I, J>
1315+
impl<I, J> StreamingIteratorMut for Flatten<I>
13201316
where
13211317
I: StreamingIteratorMut<Item = J>,
1322-
J: StreamingIteratorMut,
1318+
for<'a> J: StreamingIteratorMut + 'a,
13231319
{
13241320
#[inline]
13251321
fn get_mut(&mut self) -> Option<&mut Self::Item> {

0 commit comments

Comments
 (0)