diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2014-12-02 14:07:40 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2014-12-13 17:03:44 -0500 |
| commit | f91d87e6a03f4e64034ee8fa073ac8d47e71dc88 (patch) | |
| tree | 385190a611f2a33320a3f2440e6553e9c1ffde3f /src/libcollections/tree/map.rs | |
| parent | 1646d10edc57ec82536d6253f866084beb69a73e (diff) | |
| download | rust-f91d87e6a03f4e64034ee8fa073ac8d47e71dc88.tar.gz rust-f91d87e6a03f4e64034ee8fa073ac8d47e71dc88.zip | |
libcollections: fix fallout
Diffstat (limited to 'src/libcollections/tree/map.rs')
| -rw-r--r-- | src/libcollections/tree/map.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libcollections/tree/map.rs b/src/libcollections/tree/map.rs index 24395ca6493..95fddb6ee11 100644 --- a/src/libcollections/tree/map.rs +++ b/src/libcollections/tree/map.rs @@ -234,7 +234,9 @@ impl<K: Ord, V> TreeMap<K, V> { /// ``` #[unstable = "matches collection reform specification, waiting for dust to settle"] pub fn keys<'a>(&'a self) -> Keys<'a, K, V> { - self.iter().map(|(k, _v)| k) + fn first<A, B>((a, _): (A, B)) -> A { a } + + self.iter().map(first) } /// Gets a lazy iterator over the values in the map, in ascending order @@ -256,7 +258,9 @@ impl<K: Ord, V> TreeMap<K, V> { /// ``` #[unstable = "matches collection reform specification, waiting for dust to settle"] pub fn values<'a>(&'a self) -> Values<'a, K, V> { - self.iter().map(|(_k, v)| v) + fn second<A, B>((_, b): (A, B)) -> B { b } + + self.iter().map(second) } /// Gets a lazy iterator over the key-value pairs in the map, in ascending order. @@ -863,11 +867,11 @@ pub struct RevMutEntries<'a, K:'a, V:'a> { /// TreeMap keys iterator. pub type Keys<'a, K, V> = - iter::Map<'static, (&'a K, &'a V), &'a K, Entries<'a, K, V>>; + iter::Map<(&'a K, &'a V), &'a K, Entries<'a, K, V>, fn((&'a K, &'a V)) -> &'a K>; /// TreeMap values iterator. pub type Values<'a, K, V> = - iter::Map<'static, (&'a K, &'a V), &'a V, Entries<'a, K, V>>; + iter::Map<(&'a K, &'a V), &'a V, Entries<'a, K, V>, fn((&'a K, &'a V)) -> &'a V>; // FIXME #5846 we want to be able to choose between &x and &mut x |
