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:
est31 2021-08-05 04:22:14 +02:00
parent 25b7648496
commit 1db8737f65
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
/// 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
///

View File

@ -1035,7 +1035,9 @@ impl String {
///
/// Note that the allocator may give the collection more space than it
/// 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
///

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
/// 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
///
@ -875,7 +877,9 @@ impl<T, A: Allocator> Vec<T, A> {
///
/// Note that the allocator may give the collection more space than it
/// 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
///

View File

@ -271,7 +271,9 @@ impl OsString {
///
/// Note that the allocator may give the collection more space than it
/// 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
///