summary refs log tree commit diff
path: root/library/alloc/src/vec
diff options
context:
space:
mode:
authorTennyZhuang <zty0826@gmail.com>2021-12-05 14:19:44 +0800
committerTennyZhuang <zty0826@gmail.com>2021-12-05 14:38:59 +0800
commitaa3370c92be12d04db6a99c92044c56d453f94df (patch)
treeb76a16a34888c19f5de6d95a9609075770f93c53 /library/alloc/src/vec
parent5e93f6e318e687c05c8c44517de4586ed75ce3f4 (diff)
downloadrust-aa3370c92be12d04db6a99c92044c56d453f94df.tar.gz
rust-aa3370c92be12d04db6a99c92044c56d453f94df.zip
doc: suggest try_reserve in try_reserve_exact
Signed-off-by: TennyZhuang <zty0826@gmail.com>
Diffstat (limited to 'library/alloc/src/vec')
-rw-r--r--library/alloc/src/vec/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 88bde6e8ce4..f1b70fa2802 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -881,9 +881,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 [`try_reserve`] if future insertions are expected.
     ///
-    /// [`reserve`]: Vec::reserve
+    /// [`try_reserve`]: Vec::try_reserve
     ///
     /// # Errors
     ///