From f8a093c8ea456cb64966da2983eb988e74700fde Mon Sep 17 00:00:00 2001 From: ultrabear Date: Thu, 21 Mar 2024 02:05:11 -0700 Subject: [PATCH] document iteration ordering on into_iter method instead of IntoIterator implementation --- library/alloc/src/collections/btree/map.rs | 2 +- library/alloc/src/collections/btree/set.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index 66b45f86601..53b25a9ef25 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -1632,12 +1632,12 @@ impl<'a, K, V> IterMut<'a, K, V> { } } -/// Gets an owning iterator over the entries of the map, sorted by key. #[stable(feature = "rust1", since = "1.0.0")] impl IntoIterator for BTreeMap { type Item = (K, V); type IntoIter = IntoIter; + /// Gets an owning iterator over the entries of the map, sorted by key. fn into_iter(self) -> IntoIter { let mut me = ManuallyDrop::new(self); if let Some(root) = me.root.take() { diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs index 9c0b89188d8..a110ee9c7f3 100644 --- a/library/alloc/src/collections/btree/set.rs +++ b/library/alloc/src/collections/btree/set.rs @@ -1232,13 +1232,12 @@ impl From<[T; N]> for BTreeSet { } } -/// Gets an owning iterator over the elements of the `BTreeSet` in ascending order. #[stable(feature = "rust1", since = "1.0.0")] impl IntoIterator for BTreeSet { type Item = T; type IntoIter = IntoIter; - /// Gets an iterator for moving out the `BTreeSet`'s contents. + /// Gets an iterator for moving out the `BTreeSet`'s contents in ascending order. /// /// # Examples ///