about summary refs log tree commit diff
path: root/src/libcollections/vec_map.rs
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2014-12-02 14:07:40 -0500
committerJorge Aparicio <japaricious@gmail.com>2014-12-13 17:03:44 -0500
commitf91d87e6a03f4e64034ee8fa073ac8d47e71dc88 (patch)
tree385190a611f2a33320a3f2440e6553e9c1ffde3f /src/libcollections/vec_map.rs
parent1646d10edc57ec82536d6253f866084beb69a73e (diff)
downloadrust-f91d87e6a03f4e64034ee8fa073ac8d47e71dc88.tar.gz
rust-f91d87e6a03f4e64034ee8fa073ac8d47e71dc88.zip
libcollections: fix fallout
Diffstat (limited to 'src/libcollections/vec_map.rs')
-rw-r--r--src/libcollections/vec_map.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libcollections/vec_map.rs b/src/libcollections/vec_map.rs
index 3b8c690e047..9356c769d26 100644
--- a/src/libcollections/vec_map.rs
+++ b/src/libcollections/vec_map.rs
@@ -141,14 +141,18 @@ impl<V> VecMap<V> {
     /// The iterator's element type is `uint`.
     #[unstable = "matches collection reform specification, waiting for dust to settle"]
     pub fn keys<'r>(&'r self) -> Keys<'r, V> {
-        self.iter().map(|(k, _v)| k)
+        fn first<A, B>((a, _): (A, B)) -> A { a }
+
+        self.iter().map(first)
     }
 
     /// Returns an iterator visiting all values in ascending order by the keys.
     /// The iterator's element type is `&'r V`.
     #[unstable = "matches collection reform specification, waiting for dust to settle"]
     pub fn values<'r>(&'r self) -> Values<'r, V> {
-        self.iter().map(|(_k, v)| v)
+        fn second<A, B>((_, b): (A, B)) -> B { b }
+
+        self.iter().map(second)
     }
 
     /// Returns an iterator visiting all key-value pairs in ascending order by the keys.
@@ -620,12 +624,11 @@ iterator!(impl MutEntries -> (uint, &'a mut V), as_mut)
 double_ended_iterator!(impl MutEntries -> (uint, &'a mut V), as_mut)
 
 /// Forward iterator over the keys of a map
-pub type Keys<'a, V> =
-    iter::Map<'static, (uint, &'a V), uint, Entries<'a, V>>;
+pub type Keys<'a, V> = iter::Map<(uint, &'a V), uint, Entries<'a, V>, fn((uint, &'a V)) -> uint>;
 
 /// Forward iterator over the values of a map
 pub type Values<'a, V> =
-    iter::Map<'static, (uint, &'a V), &'a V, Entries<'a, V>>;
+    iter::Map<(uint, &'a V), &'a V, Entries<'a, V>, fn((uint, &'a V)) -> &'a V>;
 
 /// Iterator over the key-value pairs of a map, the iterator consumes the map
 pub type MoveItems<V> =