about summary refs log tree commit diff
path: root/src/libcore/vec.rs
diff options
context:
space:
mode:
authorAndrew Paseltiner <apaseltiner@gmail.com>2013-03-22 16:09:20 -0400
committerAndrew Paseltiner <apaseltiner@gmail.com>2013-03-23 06:57:30 -0400
commit45677eebf286a39c29d9cd789e76ea1cf2d2b1d0 (patch)
tree04b5fbbe19377386b540c192fba0568463da46c1 /src/libcore/vec.rs
parent2b83defa4a48303db642f38e2a9f24460756721d (diff)
downloadrust-45677eebf286a39c29d9cd789e76ea1cf2d2b1d0.tar.gz
rust-45677eebf286a39c29d9cd789e76ea1cf2d2b1d0.zip
replace impls with `deriving` where applicable
Diffstat (limited to 'src/libcore/vec.rs')
-rw-r--r--src/libcore/vec.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs
index 56d547874d8..a69655cd125 100644
--- a/src/libcore/vec.rs
+++ b/src/libcore/vec.rs
@@ -2533,12 +2533,7 @@ impl<A:Copy> iter::CopyableNonstrictIter<A> for @[A] {
 impl<A:Clone> Clone for ~[A] {
     #[inline]
     fn clone(&self) -> ~[A] {
-        let mut dolly = ~[];
-        vec::reserve(&mut dolly, self.len());
-        for self.each |item| {
-            dolly.push(item.clone());
-        }
-        return dolly;
+        self.map(|item| item.clone())
     }
 }