Skip to content

Commit 4f6f6af

Browse files
author
Jorge Aparicio
committed
libcollections: fix fallout
1 parent eede5d2 commit 4f6f6af

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

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)