@@ -20,7 +20,7 @@ implementing the `Iterator` trait.
20
20
#[ allow( default_methods) ] ; // solid enough for the use case here
21
21
22
22
use cmp;
23
- use iter:: { FromIter , Times } ;
23
+ use iter:: Times ;
24
24
use num:: { Zero , One } ;
25
25
use option:: { Option , Some , None } ;
26
26
use ops:: { Add , Mul } ;
@@ -240,7 +240,7 @@ pub trait IteratorUtil<A> {
240
240
fn advance ( & mut self , f : & fn ( A ) -> bool ) -> bool ;
241
241
242
242
/// Loops through the entire iterator, collecting all of the elements into
243
- /// a container implementing `FromIter `.
243
+ /// a container implementing `FromIterator `.
244
244
///
245
245
/// # Example
246
246
///
@@ -249,7 +249,7 @@ pub trait IteratorUtil<A> {
249
249
/// let b: ~[int] = a.iter().transform(|&x| x).collect();
250
250
/// assert!(a == b);
251
251
/// ~~~
252
- fn collect < B : FromIter < A > > ( & mut self ) -> B ;
252
+ fn collect < B : FromIterator < A , Self > > ( & mut self ) -> B ;
253
253
254
254
/// Loops through `n` iterations, returning the `n`th element of the
255
255
/// iterator.
@@ -411,8 +411,8 @@ impl<A, T: Iterator<A>> IteratorUtil<A> for T {
411
411
}
412
412
413
413
#[ 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 )
416
416
}
417
417
418
418
/// Return the `n`th item yielded by an iterator.
0 commit comments