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(v: [const T], f: fn(T) -> option) +fn filter_map(v: [T], f: fn(T) -> option) -> [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]; } }