Skip to content

Commit 584079f

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163255 b: refs/heads/snap-stage3 c: 4f6f6af h: refs/heads/master i: 163253: f2a3816 163251: cc0df05 163247: a3494ae v: v3
1 parent 180b37b commit 584079f

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: eede5d2bce06cd0546864b279389ec48e8ad7917
4+
refs/heads/snap-stage3: 4f6f6af281b47a95576b648ac924d79835f16db2
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/libcollections/vec_map.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,12 @@ impl<V> VecMap<V> {
234234
/// ```
235235
#[unstable = "matches collection reform specification, waiting for dust to settle"]
236236
pub fn into_iter(&mut self) -> MoveItems<V> {
237-
let values = replace(&mut self.v, vec!());
238-
values.into_iter().enumerate().filter_map(|(i, v)| {
237+
fn filter<A>((i, v): (uint, Option<A>)) -> Option<(uint, A)> {
239238
v.map(|v| (i, v))
240-
})
239+
}
240+
241+
let values = replace(&mut self.v, vec!());
242+
values.into_iter().enumerate().filter_map(filter)
241243
}
242244

243245
/// Return the number of elements in the map.
@@ -631,8 +633,11 @@ pub type Values<'a, V> =
631633
iter::Map<(uint, &'a V), &'a V, Entries<'a, V>, fn((uint, &'a V)) -> &'a V>;
632634

633635
/// Iterator over the key-value pairs of a map, the iterator consumes the map
634-
pub type MoveItems<V> =
635-
FilterMap<'static, (uint, Option<V>), (uint, V), Enumerate<vec::MoveItems<Option<V>>>>;
636+
pub type MoveItems<V> = FilterMap<
637+
(uint, Option<V>),
638+
(uint, V),
639+
Enumerate<vec::MoveItems<Option<V>>>,
640+
fn((uint, Option<V>)) -> Option<(uint, V)>>;
636641

637642
#[cfg(test)]
638643
mod test_map {

0 commit comments

Comments
 (0)