Skip to content

Commit 0e7ce1e

Browse files
authored
Rollup merge of rust-lang#79358 - ssomers:btree_public_comments, r=Mark-Simulacrum
BTreeMap/BTreeSet: make public doc more consistent Tweaks rust-lang#72876 and rust-lang#73667 and propagate them to `BTreeSet`.
2 parents a8c1597 + 9c8db45 commit 0e7ce1e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

library/alloc/src/collections/btree/map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for RangeMut<'_, K, V> {
458458
}
459459

460460
impl<K: Ord, V> BTreeMap<K, V> {
461-
/// Makes a new empty BTreeMap.
461+
/// Makes a new, empty `BTreeMap`.
462462
///
463463
/// Does not allocate anything on its own.
464464
///
@@ -1924,7 +1924,7 @@ impl<K: Hash, V: Hash> Hash for BTreeMap<K, V> {
19241924

19251925
#[stable(feature = "rust1", since = "1.0.0")]
19261926
impl<K: Ord, V> Default for BTreeMap<K, V> {
1927-
/// Creates an empty `BTreeMap<K, V>`.
1927+
/// Creates an empty `BTreeMap`.
19281928
fn default() -> BTreeMap<K, V> {
19291929
BTreeMap::new()
19301930
}

library/alloc/src/collections/btree/set.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ impl<T: fmt::Debug> fmt::Debug for Union<'_, T> {
220220
const ITER_PERFORMANCE_TIPPING_SIZE_DIFF: usize = 16;
221221

222222
impl<T: Ord> BTreeSet<T> {
223-
/// Makes a new `BTreeSet` with a reasonable choice of B.
223+
/// Makes a new, empty `BTreeSet`.
224+
///
225+
/// Does not allocate anything on its own.
224226
///
225227
/// # Examples
226228
///
@@ -1121,7 +1123,7 @@ impl<'a, T: 'a + Ord + Copy> Extend<&'a T> for BTreeSet<T> {
11211123

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

0 commit comments

Comments
 (0)