Skip to content

Commit 64a4dec

Browse files
committed
std: Remove typarms from IteratorExt::cloned
With associated types an where clauses none of the type parameters are necessary. [breaking-change]
1 parent 134e00b commit 64a4dec

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/libcore/iter.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,10 +967,9 @@ pub trait IteratorExt: Iterator + Sized {
967967
/// Creates an iterator that clones the elements it yields. Useful for converting an
968968
/// Iterator<&T> to an Iterator<T>.
969969
#[unstable(feature = "core", reason = "recent addition")]
970-
fn cloned<T, D>(self) -> Cloned<Self> where
971-
Self: Iterator<Item=D>,
972-
D: Deref<Target=T>,
973-
T: Clone,
970+
fn cloned(self) -> Cloned<Self> where
971+
Self::Item: Deref,
972+
<Self::Item as Deref>::Output: Clone,
974973
{
975974
Cloned { it: self }
976975
}

0 commit comments

Comments
 (0)