about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/iter.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 9c704fbd699..a220cd520c3 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -161,7 +161,7 @@ pub fn foldl<A,B,IA:BaseIter<A>>(self: &IA, b0: B, blk: &fn(&B, &A) -> B)
 
 #[inline(always)]
 pub fn to_vec<A:Copy,IA:BaseIter<A>>(self: &IA) -> ~[A] {
-    foldl::<A,~[A],IA>(self, ~[], |r, a| vec::append(copy (*r), ~[*a]))
+    map_to_vec(self, |&x| x)
 }
 
 #[inline(always)]