Rollup merge of #87780 - est31:intra_doc_links, r=jyn514

alloc: Use intra doc links for the reserve function

The sentence exists to highlight the existence of a
performance footgun of repeated calls of the
reserve_exact function.
This commit is contained in:
Yuki Okushi 2021-08-06 11:21:36 +09:00 committed by GitHub
commit b98c388352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 5 deletions

View File

@ -697,7 +697,9 @@ impl<T, A: Allocator> VecDeque<T, A> {
/// ///
/// Note that the allocator may give the collection more space than it /// Note that the allocator may give the collection more space than it
/// requests. Therefore, capacity can not be relied upon to be precisely /// requests. Therefore, capacity can not be relied upon to be precisely
/// minimal. Prefer `reserve` if future insertions are expected. /// minimal. Prefer [`reserve`] if future insertions are expected.
///
/// [`reserve`]: VecDeque::reserve
/// ///
/// # Errors /// # Errors
/// ///

View File

@ -1035,7 +1035,9 @@ impl String {
/// ///
/// Note that the allocator may give the collection more space than it /// Note that the allocator may give the collection more space than it
/// requests. Therefore, capacity can not be relied upon to be precisely /// requests. Therefore, capacity can not be relied upon to be precisely
/// minimal. Prefer `reserve` if future insertions are expected. /// minimal. Prefer [`reserve`] if future insertions are expected.
///
/// [`reserve`]: String::reserve
/// ///
/// # Errors /// # Errors
/// ///

View File

@ -811,7 +811,9 @@ impl<T, A: Allocator> Vec<T, A> {
/// ///
/// Note that the allocator may give the collection more space than it /// Note that the allocator may give the collection more space than it
/// requests. Therefore, capacity can not be relied upon to be precisely /// requests. Therefore, capacity can not be relied upon to be precisely
/// minimal. Prefer `reserve` if future insertions are expected. /// minimal. Prefer [`reserve`] if future insertions are expected.
///
/// [`reserve`]: Vec::reserve
/// ///
/// # Panics /// # Panics
/// ///
@ -875,7 +877,9 @@ impl<T, A: Allocator> Vec<T, A> {
/// ///
/// Note that the allocator may give the collection more space than it /// Note that the allocator may give the collection more space than it
/// requests. Therefore, capacity can not be relied upon to be precisely /// requests. Therefore, capacity can not be relied upon to be precisely
/// minimal. Prefer `reserve` if future insertions are expected. /// minimal. Prefer [`reserve`] if future insertions are expected.
///
/// [`reserve`]: Vec::reserve
/// ///
/// # Errors /// # Errors
/// ///

View File

@ -271,7 +271,9 @@ impl OsString {
/// ///
/// Note that the allocator may give the collection more space than it /// Note that the allocator may give the collection more space than it
/// requests. Therefore, capacity can not be relied upon to be precisely /// requests. Therefore, capacity can not be relied upon to be precisely
/// minimal. Prefer reserve if future insertions are expected. /// minimal. Prefer [`reserve`] if future insertions are expected.
///
/// [`reserve`]: OsString::reserve
/// ///
/// # Examples /// # Examples
/// ///