Skip to content

Commit 779cd09

Browse files
authored
Rollup merge of #91547 - TennyZhuang:suggest_try_reserve, r=scottmcm
Suggest try_reserve in try_reserve_exact During developing #91529 , I found that `try_reserve_exact` suggests `reserve` for further insertions. I think it's a mistake by copy&paste, `try_reserve` is better here.
2 parents fd0ac8e + aa3370c commit 779cd09

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)