From e31116af50f35ff81f83561ba607c610f42bbf4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Tue, 4 Aug 2020 22:00:32 +0200 Subject: [PATCH 1/8] Add `into_{keys,values}` methods for HashMap --- library/std/src/collections/hash/map.rs | 128 ++++++++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index c40d6119fdfc9..f12009e4c2094 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -872,6 +872,52 @@ where { self.base.retain(f) } + + /// Creates a consuming iterator visiting all the keys in arbitrary order. + /// The map cannot be used after calling this. + /// The iterator element type is `K`. + /// + /// # Examples + /// + /// ``` + /// #![feature(map_into_keys_values)] + /// use std::collections::HashMap; + /// + /// let mut map = HashMap::new(); + /// map.insert("a", 1); + /// map.insert("b", 2); + /// map.insert("c", 3); + /// + /// let vec: Vec<&str> = map.into_keys().collect(); + /// ``` + #[inline] + #[unstable(feature = "map_into_keys_values", issue = "55214")] + pub fn into_keys(self) -> IntoKeys { + IntoKeys { inner: self.into_iter() } + } + + /// Creates a consuming iterator visiting all the values in arbitrary order. + /// The map cannot be used after calling this. + /// The iterator element type is `V`. + /// + /// # Examples + /// + /// ``` + /// #![feature(map_into_keys_values)] + /// use std::collections::HashMap; + /// + /// let mut map = HashMap::new(); + /// map.insert("a", 1); + /// map.insert("b", 2); + /// map.insert("c", 3); + /// + /// let vec: Vec = map.into_values().collect(); + /// ``` + #[inline] + #[unstable(feature = "map_into_keys_values", issue = "55214")] + pub fn into_values(self) -> IntoValues { + IntoValues { inner: self.into_iter() } + } } impl HashMap @@ -1154,6 +1200,28 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> { inner: IterMut<'a, K, V>, } +/// An owning iterator over the keys of a `HashMap`. +/// +/// This `struct` is created by the [`into_keys`] method on [`HashMap`]. +/// See its documentation for more. +/// +/// [`into_keys`]: HashMap::into_keys +#[unstable(feature = "map_into_keys_values", issue = "55214")] +pub struct IntoKeys { + inner: IntoIter, +} + +/// An owning iterator over the values of a `HashMap`. +/// +/// This `struct` is created by the [`into_values`] method on [`HashMap`]. +/// See its documentation for more. +/// +/// [`into_values`]: HashMap::into_values +#[unstable(feature = "map_into_keys_values", issue = "55214")] +pub struct IntoValues { + inner: IntoIter, +} + /// A builder for computing where in a HashMap a key-value pair would be stored. /// /// See the [`HashMap::raw_entry_mut`] docs for usage examples. @@ -1827,6 +1895,66 @@ where } } +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl Iterator for IntoKeys { + type Item = K; + + #[inline] + fn next(&mut self) -> Option { + self.inner.next().map(|(k, _)| k) + } + #[inline] + fn size_hint(&self) -> (usize, Option) { + self.inner.size_hint() + } +} +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl ExactSizeIterator for IntoKeys { + #[inline] + fn len(&self) -> usize { + self.inner.len() + } +} +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl FusedIterator for IntoKeys {} + +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl fmt::Debug for IntoKeys { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_list().entries(self.inner.iter()).finish() + } +} + +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl Iterator for IntoValues { + type Item = V; + + #[inline] + fn next(&mut self) -> Option { + self.inner.next().map(|(_, v)| v) + } + #[inline] + fn size_hint(&self) -> (usize, Option) { + self.inner.size_hint() + } +} +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl ExactSizeIterator for IntoValues { + #[inline] + fn len(&self) -> usize { + self.inner.len() + } +} +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl FusedIterator for IntoValues {} + +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl fmt::Debug for IntoValues { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_list().entries(self.inner.iter()).finish() + } +} + #[stable(feature = "drain", since = "1.6.0")] impl<'a, K, V> Iterator for Drain<'a, K, V> { type Item = (K, V); From 13529f22ba574e723bea2514ba153bd0dc53bfbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Tue, 4 Aug 2020 22:01:12 +0200 Subject: [PATCH 2/8] Add `into_{keys,values}` methods for BTreeMap --- library/alloc/src/collections/btree/map.rs | 156 +++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index 1d5fa73d228e2..3e7433dfbcfa4 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -1,3 +1,5 @@ +// ignore-tidy-filelength + use core::borrow::Borrow; use core::cmp::Ordering; use core::fmt::Debug; @@ -355,6 +357,30 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> { inner: IterMut<'a, K, V>, } +/// An owning iterator over the keys of a `BTreeMap`. +/// +/// This `struct` is created by the [`into_keys`] method on [`BTreeMap`]. +/// See its documentation for more. +/// +/// [`into_keys`]: BTreeMap::into_keys +#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[derive(Debug)] +pub struct IntoKeys { + inner: IntoIter, +} + +/// An owning iterator over the values of a `BTreeMap`. +/// +/// This `struct` is created by the [`into_values`] method on [`BTreeMap`]. +/// See its documentation for more. +/// +/// [`into_values`]: BTreeMap::into_values +#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[derive(Debug)] +pub struct IntoValues { + inner: IntoIter, +} + /// An iterator over a sub-range of entries in a `BTreeMap`. /// /// This `struct` is created by the [`range`] method on [`BTreeMap`]. See its @@ -1291,6 +1317,52 @@ impl BTreeMap { self.length = dfs(self.root.as_ref().unwrap().as_ref()); } + + /// Creates a consuming iterator visiting all the keys, in sorted order. + /// The map cannot be used after calling this. + /// The iterator element type is `K`. + /// + /// # Examples + /// + /// ``` + /// #![feature(map_into_keys_values)] + /// use std::collections::BTreeMap; + /// + /// let mut a = BTreeMap::new(); + /// a.insert(2, "b"); + /// a.insert(1, "a"); + /// + /// let keys: Vec = a.into_keys().collect(); + /// assert_eq!(keys, [1, 2]); + /// ``` + #[inline] + #[unstable(feature = "map_into_keys_values", issue = "55214")] + pub fn into_keys(self) -> IntoKeys { + IntoKeys { inner: self.into_iter() } + } + + /// Creates a consuming iterator visiting all the values, in sorted order. + /// The map cannot be used after calling this. + /// The iterator element type is `V`. + /// + /// # Examples + /// + /// ``` + /// #![feature(map_into_keys_values)] + /// use std::collections::BTreeMap; + /// + /// let mut a = BTreeMap::new(); + /// a.insert(1, "hello"); + /// a.insert(2, "goodbye"); + /// + /// let values: Vec<&str> = a.into_values().collect(); + /// assert_eq!(values, ["hello", "goodbye"]); + /// ``` + #[inline] + #[unstable(feature = "map_into_keys_values", issue = "55214")] + pub fn into_values(self) -> IntoValues { + IntoValues { inner: self.into_iter() } + } } #[stable(feature = "rust1", since = "1.0.0")] @@ -1781,6 +1853,90 @@ impl<'a, K, V> Range<'a, K, V> { } } +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl Iterator for IntoKeys { + type Item = K; + + fn next(&mut self) -> Option { + self.inner.next().map(|(k, _)| k) + } + + fn size_hint(&self) -> (usize, Option) { + self.inner.size_hint() + } + + fn last(mut self) -> Option { + self.next_back() + } + + fn min(mut self) -> Option { + self.next() + } + + fn max(mut self) -> Option { + self.next_back() + } +} + +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl DoubleEndedIterator for IntoKeys { + fn next_back(&mut self) -> Option { + self.inner.next_back().map(|(k, _)| k) + } +} + +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl ExactSizeIterator for IntoKeys { + fn len(&self) -> usize { + self.inner.len() + } +} + +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl FusedIterator for IntoKeys {} + +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl Iterator for IntoValues { + type Item = V; + + fn next(&mut self) -> Option { + self.inner.next().map(|(_, v)| v) + } + + fn size_hint(&self) -> (usize, Option) { + self.inner.size_hint() + } + + fn last(mut self) -> Option { + self.next_back() + } + + fn min(mut self) -> Option { + self.next() + } + + fn max(mut self) -> Option { + self.next_back() + } +} + +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl DoubleEndedIterator for IntoValues { + fn next_back(&mut self) -> Option { + self.inner.next_back().map(|(_, v)| v) + } +} + +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl ExactSizeIterator for IntoValues { + fn len(&self) -> usize { + self.inner.len() + } +} + +#[unstable(feature = "map_into_keys_values", issue = "55214")] +impl FusedIterator for IntoValues {} + #[stable(feature = "btree_range", since = "1.17.0")] impl<'a, K, V> DoubleEndedIterator for Range<'a, K, V> { fn next_back(&mut self) -> Option<(&'a K, &'a V)> { From 41dd4ee7ffea3e2bed0422675143426b322fc23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Tue, 4 Aug 2020 22:04:12 +0200 Subject: [PATCH 3/8] Add unit tests for new `HashMap::into_{keys,values}` methods --- library/std/src/collections/hash/map.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index f12009e4c2094..091687335bb66 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -3212,6 +3212,30 @@ mod test_map { assert!(values.contains(&6)); } + #[test] + fn test_into_keys() { + let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; + let map: HashMap<_, _> = vec.into_iter().collect(); + let keys: Vec<_> = map.into_keys().collect(); + + assert_eq!(keys.len(), 3); + assert!(keys.contains(&1)); + assert!(keys.contains(&2)); + assert!(keys.contains(&3)); + } + + #[test] + fn test_into_values() { + let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; + let map: HashMap<_, _> = vec.into_iter().collect(); + let values: Vec<_> = map.into_values().collect(); + + assert_eq!(values.len(), 3); + assert!(values.contains(&'a')); + assert!(values.contains(&'b')); + assert!(values.contains(&'c')); + } + #[test] fn test_find() { let mut m = HashMap::new(); From 29d9233cf6cc874a03f8a8040115ade40feedf23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Tue, 4 Aug 2020 22:05:03 +0200 Subject: [PATCH 4/8] Add unit tests for new `BTreeMap::into_{keys,values}` methods --- library/alloc/tests/btree/map.rs | 24 ++++++++++++++++++++++++ library/alloc/tests/lib.rs | 1 + 2 files changed, 25 insertions(+) diff --git a/library/alloc/tests/btree/map.rs b/library/alloc/tests/btree/map.rs index f9f81716e357c..5777bd6090714 100644 --- a/library/alloc/tests/btree/map.rs +++ b/library/alloc/tests/btree/map.rs @@ -1461,3 +1461,27 @@ fn test_into_iter_drop_leak_height_1() { assert_eq!(DROPS.load(Ordering::SeqCst), size); } } + +#[test] +fn test_into_keys() { + let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; + let map: BTreeMap<_, _> = vec.into_iter().collect(); + let keys: Vec<_> = map.into_keys().collect(); + + assert_eq!(keys.len(), 3); + assert!(keys.contains(&1)); + assert!(keys.contains(&2)); + assert!(keys.contains(&3)); +} + +#[test] +fn test_into_values() { + let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; + let map: BTreeMap<_, _> = vec.into_iter().collect(); + let values: Vec<_> = map.into_values().collect(); + + assert_eq!(values.len(), 3); + assert!(values.contains(&'a')); + assert!(values.contains(&'b')); + assert!(values.contains(&'c')); +} diff --git a/library/alloc/tests/lib.rs b/library/alloc/tests/lib.rs index c680a3fc25bd4..3aacd4a687e38 100644 --- a/library/alloc/tests/lib.rs +++ b/library/alloc/tests/lib.rs @@ -4,6 +4,7 @@ #![feature(drain_filter)] #![feature(exact_size_is_empty)] #![feature(map_first_last)] +#![feature(map_into_keys_values)] #![feature(new_uninit)] #![feature(pattern)] #![feature(str_split_once)] From 25545ed18058ca09d98fad50a5405f2ad6c0ec5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Fri, 7 Aug 2020 13:47:04 +0200 Subject: [PATCH 5/8] Only print the fields that are relevant to iterators for Debug of IntoKeys and IntoValues --- library/std/src/collections/hash/map.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 091687335bb66..df2dcba0ef362 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -1921,7 +1921,7 @@ impl FusedIterator for IntoKeys {} #[unstable(feature = "map_into_keys_values", issue = "55214")] impl fmt::Debug for IntoKeys { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_list().entries(self.inner.iter()).finish() + f.debug_list().entries(self.inner.iter().map(|(k, _)| k)).finish() } } @@ -1951,7 +1951,7 @@ impl FusedIterator for IntoValues {} #[unstable(feature = "map_into_keys_values", issue = "55214")] impl fmt::Debug for IntoValues { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_list().entries(self.inner.iter()).finish() + f.debug_list().entries(self.inner.iter().map(|(_, v)| v)).finish() } } From 16a52171414d94f45e32b4cd7e2698329c330dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Fri, 7 Aug 2020 14:10:12 +0200 Subject: [PATCH 6/8] Change the comment of BTreeMap::into_values --- library/alloc/src/collections/btree/map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index 3e7433dfbcfa4..5814fb8e40daf 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -1341,7 +1341,7 @@ impl BTreeMap { IntoKeys { inner: self.into_iter() } } - /// Creates a consuming iterator visiting all the values, in sorted order. + /// Creates a consuming iterator visiting all the values, in order by key. /// The map cannot be used after calling this. /// The iterator element type is `V`. /// From 1cdce3919fe838ad7718b4cc7ca7b62300e8575b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Sat, 8 Aug 2020 15:39:26 +0200 Subject: [PATCH 7/8] Remove min/max values from IntoValues Iterator implementation --- library/alloc/src/collections/btree/map.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index 5814fb8e40daf..1e09db6cc3951 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -1910,14 +1910,6 @@ impl Iterator for IntoValues { fn last(mut self) -> Option { self.next_back() } - - fn min(mut self) -> Option { - self.next() - } - - fn max(mut self) -> Option { - self.next_back() - } } #[unstable(feature = "map_into_keys_values", issue = "55214")] From 4cd2637e2bf1016c95a401a4d5cc70406fbacf08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Sat, 8 Aug 2020 16:34:42 +0200 Subject: [PATCH 8/8] Update the tracking issue number of map_into_keys_values --- library/alloc/src/collections/btree/map.rs | 24 +++++++++++----------- library/std/src/collections/hash/map.rs | 24 +++++++++++----------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index 1e09db6cc3951..b8ae1ed318f67 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -363,7 +363,7 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> { /// See its documentation for more. /// /// [`into_keys`]: BTreeMap::into_keys -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] #[derive(Debug)] pub struct IntoKeys { inner: IntoIter, @@ -375,7 +375,7 @@ pub struct IntoKeys { /// See its documentation for more. /// /// [`into_values`]: BTreeMap::into_values -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] #[derive(Debug)] pub struct IntoValues { inner: IntoIter, @@ -1336,7 +1336,7 @@ impl BTreeMap { /// assert_eq!(keys, [1, 2]); /// ``` #[inline] - #[unstable(feature = "map_into_keys_values", issue = "55214")] + #[unstable(feature = "map_into_keys_values", issue = "75294")] pub fn into_keys(self) -> IntoKeys { IntoKeys { inner: self.into_iter() } } @@ -1359,7 +1359,7 @@ impl BTreeMap { /// assert_eq!(values, ["hello", "goodbye"]); /// ``` #[inline] - #[unstable(feature = "map_into_keys_values", issue = "55214")] + #[unstable(feature = "map_into_keys_values", issue = "75294")] pub fn into_values(self) -> IntoValues { IntoValues { inner: self.into_iter() } } @@ -1853,7 +1853,7 @@ impl<'a, K, V> Range<'a, K, V> { } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl Iterator for IntoKeys { type Item = K; @@ -1878,24 +1878,24 @@ impl Iterator for IntoKeys { } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl DoubleEndedIterator for IntoKeys { fn next_back(&mut self) -> Option { self.inner.next_back().map(|(k, _)| k) } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl ExactSizeIterator for IntoKeys { fn len(&self) -> usize { self.inner.len() } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl FusedIterator for IntoKeys {} -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl Iterator for IntoValues { type Item = V; @@ -1912,21 +1912,21 @@ impl Iterator for IntoValues { } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl DoubleEndedIterator for IntoValues { fn next_back(&mut self) -> Option { self.inner.next_back().map(|(_, v)| v) } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl ExactSizeIterator for IntoValues { fn len(&self) -> usize { self.inner.len() } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl FusedIterator for IntoValues {} #[stable(feature = "btree_range", since = "1.17.0")] diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index df2dcba0ef362..70f7214e2f1d7 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -891,7 +891,7 @@ where /// let vec: Vec<&str> = map.into_keys().collect(); /// ``` #[inline] - #[unstable(feature = "map_into_keys_values", issue = "55214")] + #[unstable(feature = "map_into_keys_values", issue = "75294")] pub fn into_keys(self) -> IntoKeys { IntoKeys { inner: self.into_iter() } } @@ -914,7 +914,7 @@ where /// let vec: Vec = map.into_values().collect(); /// ``` #[inline] - #[unstable(feature = "map_into_keys_values", issue = "55214")] + #[unstable(feature = "map_into_keys_values", issue = "75294")] pub fn into_values(self) -> IntoValues { IntoValues { inner: self.into_iter() } } @@ -1206,7 +1206,7 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> { /// See its documentation for more. /// /// [`into_keys`]: HashMap::into_keys -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] pub struct IntoKeys { inner: IntoIter, } @@ -1217,7 +1217,7 @@ pub struct IntoKeys { /// See its documentation for more. /// /// [`into_values`]: HashMap::into_values -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] pub struct IntoValues { inner: IntoIter, } @@ -1895,7 +1895,7 @@ where } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl Iterator for IntoKeys { type Item = K; @@ -1908,24 +1908,24 @@ impl Iterator for IntoKeys { self.inner.size_hint() } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl ExactSizeIterator for IntoKeys { #[inline] fn len(&self) -> usize { self.inner.len() } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl FusedIterator for IntoKeys {} -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl fmt::Debug for IntoKeys { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.inner.iter().map(|(k, _)| k)).finish() } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl Iterator for IntoValues { type Item = V; @@ -1938,17 +1938,17 @@ impl Iterator for IntoValues { self.inner.size_hint() } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl ExactSizeIterator for IntoValues { #[inline] fn len(&self) -> usize { self.inner.len() } } -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl FusedIterator for IntoValues {} -#[unstable(feature = "map_into_keys_values", issue = "55214")] +#[unstable(feature = "map_into_keys_values", issue = "75294")] impl fmt::Debug for IntoValues { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_list().entries(self.inner.iter().map(|(_, v)| v)).finish()