diff options
| author | bors <bors@rust-lang.org> | 2013-08-10 13:17:19 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-08-10 13:17:19 -0700 |
| commit | 8b9e1ce75a3e1416f2db80d30f65879fd902183f (patch) | |
| tree | 07b97a6ad0d382272a978018c71c5220cece8237 /src/libsyntax/opt_vec.rs | |
| parent | 2ba36ec62934c8b877766a6283633b6407c8d357 (diff) | |
| parent | c8a93efdae48b88bf594480705a5c0aac39c75e1 (diff) | |
auto merge of #8430 : erickt/rust/cleanup-iterators, r=erickt
This PR does a bunch of cleaning up of various APIs. The major one is that it merges `Iterator` and `IteratorUtil`, and renames functions like `transform` into `map`. I also merged `DoubleEndedIterator` and `DoubleEndedIteratorUtil`, as well as I renamed various .consume* functions to .move_iter(). This helps to implement part of #7887.
Diffstat (limited to 'src/libsyntax/opt_vec.rs')
| -rw-r--r-- | src/libsyntax/opt_vec.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/opt_vec.rs b/src/libsyntax/opt_vec.rs index 10603751a06..5d79532c8c5 100644 --- a/src/libsyntax/opt_vec.rs +++ b/src/libsyntax/opt_vec.rs @@ -57,10 +57,10 @@ impl<T> OptVec<T> { } } - fn map_consume<U>(self, op: &fn(T) -> U) -> OptVec<U> { + fn map_move<U>(self, op: &fn(T) -> U) -> OptVec<U> { match self { Empty => Empty, - Vec(v) => Vec(v.consume_iter().transform(op).collect()) + Vec(v) => Vec(v.move_iter().map(op).collect()) } } @@ -92,7 +92,7 @@ impl<T> OptVec<T> { #[inline] fn map_to_vec<B>(&self, op: &fn(&T) -> B) -> ~[B] { - self.iter().transform(op).collect() + self.iter().map(op).collect() } fn mapi_to_vec<B>(&self, op: &fn(uint, &T) -> B) -> ~[B] { |
