BTree(Set|Map): Guarantee that IntoIter
will iterate in sorted by key order
This commit is contained in:
parent
6e1f7b538a
commit
f6f89dc202
2 changed files with 4 additions and 2 deletions
|
@ -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.
|
||||
|
@ -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.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<K, V, A: Allocator + Clone> IntoIterator for BTreeMap<K, V, A> {
|
||||
type Item = (K, V);
|
||||
|
|
|
@ -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.
|
||||
|
@ -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.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T, A: Allocator + Clone> IntoIterator for BTreeSet<T, A> {
|
||||
type Item = T;
|
||||
|
|
Loading…
Add table
Reference in a new issue