]> git.lizzy.rs Git - rust.git/commitdiff
std: Remove typarms from IteratorExt::cloned
authorAlex Crichton <alex@alexcrichton.com>
Fri, 6 Feb 2015 22:47:09 +0000 (14:47 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 9 Feb 2015 23:58:13 +0000 (15:58 -0800)
With associated types an where clauses none of the type parameters are
necessary.

[breaking-change]

src/libcore/iter.rs

index 5df64cfaadaaab243b41d17ba90fc4fa19eea810..fcf46b81a57af9939b7b91a7517c969ca210e1dc 100644 (file)
@@ -967,10 +967,9 @@ fn size_hint(&self) -> (usize, Option<usize>) {
     /// Creates an iterator that clones the elements it yields. Useful for converting an
     /// Iterator<&T> to an Iterator<T>.
     #[unstable(feature = "core", reason = "recent addition")]
-    fn cloned<T, D>(self) -> Cloned<Self> where
-        Self: Iterator<Item=D>,
-        D: Deref<Target=T>,
-        T: Clone,
+    fn cloned(self) -> Cloned<Self> where
+        Self::Item: Deref,
+        <Self::Item as Deref>::Output: Clone,
     {
         Cloned { it: self }
     }