Skip to content

Commit

Permalink
Rollup merge of rust-lang#79358 - ssomers:btree_public_comments, r=Ma…
Browse files Browse the repository at this point in the history
…rk-Simulacrum

BTreeMap/BTreeSet: make public doc more consistent

Tweaks rust-lang#72876 and rust-lang#73667 and propagate them to `BTreeSet`.
  • Loading branch information
jonas-schievink committed Nov 24, 2020
2 parents 012d5fd + 9c8db45 commit ce19796
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/alloc/src/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for RangeMut<'_, K, V> {
}

impl<K: Ord, V> BTreeMap<K, V> {
/// Makes a new empty BTreeMap.
/// Makes a new, empty `BTreeMap`.
///
/// Does not allocate anything on its own.
///
Expand Down Expand Up @@ -1924,7 +1924,7 @@ impl<K: Hash, V: Hash> Hash for BTreeMap<K, V> {

#[stable(feature = "rust1", since = "1.0.0")]
impl<K: Ord, V> Default for BTreeMap<K, V> {
/// Creates an empty `BTreeMap<K, V>`.
/// Creates an empty `BTreeMap`.
fn default() -> BTreeMap<K, V> {
BTreeMap::new()
}
Expand Down
6 changes: 4 additions & 2 deletions library/alloc/src/collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ impl<T: fmt::Debug> fmt::Debug for Union<'_, T> {
const ITER_PERFORMANCE_TIPPING_SIZE_DIFF: usize = 16;

impl<T: Ord> BTreeSet<T> {
/// Makes a new `BTreeSet` with a reasonable choice of B.
/// Makes a new, empty `BTreeSet`.
///
/// Does not allocate anything on its own.
///
/// # Examples
///
Expand Down Expand Up @@ -1121,7 +1123,7 @@ impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BTreeSet<T> {

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Ord> Default for BTreeSet<T> {
/// Makes an empty `BTreeSet<T>` with a reasonable choice of B.
/// Creates an empty `BTreeSet`.
fn default() -> BTreeSet<T> {
BTreeSet::new()
}
Expand Down

0 comments on commit ce19796

Please sign in to comment.