Skip to content

Commit aa3370c

Browse files
committed
doc: suggest try_reserve in try_reserve_exact
Signed-off-by: TennyZhuang <[email protected]>
1 parent 5e93f6e commit aa3370c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

library/alloc/src/collections/vec_deque/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -720,9 +720,9 @@ impl<T, A: Allocator> VecDeque<T, A> {
720720
///
721721
/// Note that the allocator may give the collection more space than it
722722
/// requests. Therefore, capacity can not be relied upon to be precisely
723-
/// minimal. Prefer [`reserve`] if future insertions are expected.
723+
/// minimal. Prefer [`try_reserve`] if future insertions are expected.
724724
///
725-
/// [`reserve`]: VecDeque::reserve
725+
/// [`try_reserve`]: VecDeque::try_reserve
726726
///
727727
/// # Errors
728728
///

library/alloc/src/string.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1044,9 +1044,9 @@ impl String {
10441044
///
10451045
/// Note that the allocator may give the collection more space than it
10461046
/// requests. Therefore, capacity can not be relied upon to be precisely
1047-
/// minimal. Prefer [`reserve`] if future insertions are expected.
1047+
/// minimal. Prefer [`try_reserve`] if future insertions are expected.
10481048
///
1049-
/// [`reserve`]: String::reserve
1049+
/// [`try_reserve`]: String::try_reserve
10501050
///
10511051
/// # Errors
10521052
///

library/alloc/src/vec/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -881,9 +881,9 @@ impl<T, A: Allocator> Vec<T, A> {
881881
///
882882
/// Note that the allocator may give the collection more space than it
883883
/// requests. Therefore, capacity can not be relied upon to be precisely
884-
/// minimal. Prefer [`reserve`] if future insertions are expected.
884+
/// minimal. Prefer [`try_reserve`] if future insertions are expected.
885885
///
886-
/// [`reserve`]: Vec::reserve
886+
/// [`try_reserve`]: Vec::try_reserve
887887
///
888888
/// # Errors
889889
///

0 commit comments

Comments
 (0)