Skip to content

Commit 3ee4a15

Browse files
committed
core: Don't copy elements in filter_map
1 parent 35e9970 commit 3ee4a15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,11 @@ Apply a function to each element of a vector and return the results
430430
If function `f` returns `none` then that element is excluded from
431431
the resulting vector.
432432
"]
433-
fn filter_map<T: copy, U: copy>(v: [const T], f: fn(T) -> option<U>)
433+
fn filter_map<T: copy, U: copy>(v: [T], f: fn(T) -> option<U>)
434434
-> [U] {
435435
let mut result = [];
436436
for elem: T in v {
437-
alt f(copy elem) {
437+
alt f(elem) {
438438
none {/* no-op */ }
439439
some(result_elem) { result += [result_elem]; }
440440
}

0 commit comments

Comments
 (0)