@@ -20,7 +20,7 @@ implementing the `Iterator` trait.
2020#[ allow( default_methods) ] ; // solid enough for the use case here
2121
2222use cmp;
23- use iter:: { FromIter , Times } ;
23+ use iter:: Times ;
2424use num:: { Zero , One } ;
2525use option:: { Option , Some , None } ;
2626use ops:: { Add , Mul } ;
@@ -240,7 +240,7 @@ pub trait IteratorUtil<A> {
240240 fn advance ( & mut self , f : & fn ( A ) -> bool ) -> bool ;
241241
242242 /// Loops through the entire iterator, collecting all of the elements into
243- /// a container implementing `FromIter `.
243+ /// a container implementing `FromIterator `.
244244 ///
245245 /// # Example
246246 ///
@@ -249,7 +249,7 @@ pub trait IteratorUtil<A> {
249249 /// let b: ~[int] = a.iter().transform(|&x| x).collect();
250250 /// assert!(a == b);
251251 /// ~~~
252- fn collect < B : FromIter < A > > ( & mut self ) -> B ;
252+ fn collect < B : FromIterator < A , Self > > ( & mut self ) -> B ;
253253
254254 /// Loops through `n` iterations, returning the `n`th element of the
255255 /// iterator.
@@ -411,8 +411,8 @@ impl<A, T: Iterator<A>> IteratorUtil<A> for T {
411411 }
412412
413413 #[ inline]
414- fn collect < B : FromIter < A > > ( & mut self ) -> B {
415- FromIter :: from_iter :: < A , B > ( |f| self . advance ( f ) )
414+ fn collect < B : FromIterator < A , T > > ( & mut self ) -> B {
415+ FromIterator :: from_iterator ( self )
416416 }
417417
418418 /// Return the `n`th item yielded by an iterator.
0 commit comments