@@ -234,10 +234,12 @@ impl<V> VecMap<V> {
234
234
/// ```
235
235
#[ unstable = "matches collection reform specification, waiting for dust to settle" ]
236
236
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 ) > {
239
238
v. map ( |v| ( i, v) )
240
- } )
239
+ }
240
+
241
+ let values = replace ( & mut self . v , vec ! ( ) ) ;
242
+ values. into_iter ( ) . enumerate ( ) . filter_map ( filter)
241
243
}
242
244
243
245
/// Return the number of elements in the map.
@@ -631,8 +633,11 @@ pub type Values<'a, V> =
631
633
iter:: Map < ( uint , & ' a V ) , & ' a V , Entries < ' a , V > , fn ( ( uint , & ' a V ) ) -> & ' a V > ;
632
634
633
635
/// 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 ) > > ;
636
641
637
642
#[ cfg( test) ]
638
643
mod test_map {
0 commit comments