Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc Guarantee: BTree(Set|Map): IntoIter Iterate in Sorted by key Order #122817

Merged
merged 3 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion library/alloc/src/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ impl<'a, K: 'a, V: 'a> Default for IterMut<'a, K, V> {
}
}

/// An owning iterator over the entries of a `BTreeMap`.
/// An owning iterator over the entries of a `BTreeMap`, sorted by key.
///
/// This `struct` is created by the [`into_iter`] method on [`BTreeMap`]
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
Expand Down Expand Up @@ -1632,6 +1632,7 @@ impl<'a, K, V> IterMut<'a, K, V> {
}
}

/// Gets an owning iterator over the entries of the map, sorted by key.
ultrabear marked this conversation as resolved.
Show resolved Hide resolved
#[stable(feature = "rust1", since = "1.0.0")]
impl<K, V, A: Allocator + Clone> IntoIterator for BTreeMap<K, V, A> {
type Item = (K, V);
Expand Down
3 changes: 2 additions & 1 deletion library/alloc/src/collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl<T: fmt::Debug> fmt::Debug for Iter<'_, T> {
}
}

/// An owning iterator over the items of a `BTreeSet`.
/// An owning iterator over the items of a `BTreeSet` in ascending order.
///
/// This `struct` is created by the [`into_iter`] method on [`BTreeSet`]
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
Expand Down Expand Up @@ -1232,6 +1232,7 @@ 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.
ultrabear marked this conversation as resolved.
Show resolved Hide resolved
#[stable(feature = "rust1", since = "1.0.0")]
impl<T, A: Allocator + Clone> IntoIterator for BTreeSet<T, A> {
type Item = T;
Expand Down
Loading