about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-03-17 18:17:27 -0700
committerBrian Anderson <banderson@mozilla.com>2012-03-17 18:17:27 -0700
commit3ee4a15e5e1be8d1baa529ccf2c64ba4a88abc93 (patch)
treed55aafc8851b696cfb4c13f3b709556c82c15298
parent35e9970e29cfc075968e3a1b9d4e1293ab7ab98b (diff)
downloadrust-3ee4a15e5e1be8d1baa529ccf2c64ba4a88abc93.tar.gz
rust-3ee4a15e5e1be8d1baa529ccf2c64ba4a88abc93.zip
core: Don't copy elements in filter_map
-rw-r--r--src/libcore/vec.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs
index d69507b75c1..6beda8306e2 100644
--- a/src/libcore/vec.rs
+++ b/src/libcore/vec.rs
@@ -430,11 +430,11 @@ Apply a function to each element of a vector and return the results
 If function `f` returns `none` then that element is excluded from
 the resulting vector.
 "]
-fn filter_map<T: copy, U: copy>(v: [const T], f: fn(T) -> option<U>)
+fn filter_map<T: copy, U: copy>(v: [T], f: fn(T) -> option<U>)
     -> [U] {
     let mut result = [];
     for elem: T in v {
-        alt f(copy elem) {
+        alt f(elem) {
           none {/* no-op */ }
           some(result_elem) { result += [result_elem]; }
         }