diff options
| author | ultrabear <bearodark@gmail.com> | 2024-03-21 02:05:11 -0700 |
|---|---|---|
| committer | ultrabear <bearodark@gmail.com> | 2024-03-21 02:05:11 -0700 |
| commit | f8a093c8ea456cb64966da2983eb988e74700fde (patch) | |
| tree | 62115de4549a27bf02438345e2cac37f2bd2826c /library/alloc/src | |
| parent | f6f89dc2023315b777f0ffef3b4c4573d364beb8 (diff) | |
| download | rust-f8a093c8ea456cb64966da2983eb988e74700fde.tar.gz rust-f8a093c8ea456cb64966da2983eb988e74700fde.zip | |
document iteration ordering on into_iter method instead of IntoIterator implementation
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/collections/btree/map.rs | 2 | ||||
| -rw-r--r-- | 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<K, V, A: Allocator + Clone> IntoIterator for BTreeMap<K, V, A> { type Item = (K, V); type IntoIter = IntoIter<K, V, A>; + /// Gets an owning iterator over the entries of the map, sorted by key. fn into_iter(self) -> IntoIter<K, V, A> { 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<T: Ord, const N: usize> From<[T; N]> for BTreeSet<T> { } } -/// Gets an owning iterator over the elements of the `BTreeSet` in ascending order. #[stable(feature = "rust1", since = "1.0.0")] impl<T, A: Allocator + Clone> IntoIterator for BTreeSet<T, A> { type Item = T; type IntoIter = IntoIter<T, A>; - /// Gets an iterator for moving out the `BTreeSet`'s contents. + /// Gets an iterator for moving out the `BTreeSet`'s contents in ascending order. /// /// # Examples /// |
