Rollup merge of #72876 - TrolledWoods:patch-2, r=Dylan-DPC

Mention that BTreeMap::new() doesn't allocate

I think it would be nice to mention this, so you don't have to dig through the src to look at the definition of new().
This commit is contained in:
Manish Goregaokar 2020-06-23 13:10:01 -07:00 committed by GitHub
commit 317a15142e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -490,6 +490,8 @@ struct MergeIter<K, V, I: Iterator<Item = (K, V)>> {
impl<K: Ord, V> BTreeMap<K, V> {
/// Makes a new empty BTreeMap with a reasonable choice for B.
///
/// Does not allocate anything on its own.
///
/// # Examples
///
/// Basic usage: