From fd7479a8922260a3c6b872ddd68760d204aa1108 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Fri, 25 Sep 2020 23:41:39 +0800 Subject: [PATCH 1/3] Fix typo in vec doc "tries to reserves" --- library/alloc/src/vec.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index c54b3aef95ed4..793f7caa9f2e4 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -567,9 +567,10 @@ impl Vec { self.buf.try_reserve(self.len, additional) } - /// Tries to reserves the minimum capacity for exactly `additional` more elements to - /// be inserted in the given `Vec`. After calling `try_reserve_exact`, - /// capacity will be greater than or equal to `self.len() + additional`. + /// Tries to reserve the minimum capacity for exactly `additional` more + /// elements to be inserted in the given `Vec`. After calling + /// `try_reserve_exact`, capacity will be greater than or equal to + /// `self.len() + additional`. /// Does nothing if the capacity is already sufficient. /// /// Note that the allocator may give the collection more space than it From e20f76998a8b5c3205ba1f86d28b3cb40cb0e43c Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Sat, 26 Sep 2020 00:13:14 +0800 Subject: [PATCH 2/3] Remove unnecessary "more" word in vec doc Co-authored-by: Mark Rousskov --- library/alloc/src/vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index 793f7caa9f2e4..4ec41a5bade6f 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -567,7 +567,7 @@ impl Vec { self.buf.try_reserve(self.len, additional) } - /// Tries to reserve the minimum capacity for exactly `additional` more + /// Tries to reserve the minimum capacity for exactly `additional` /// elements to be inserted in the given `Vec`. After calling /// `try_reserve_exact`, capacity will be greater than or equal to /// `self.len() + additional`. From c635be0c5e3f38c094098a60a20ea7aa5c935138 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Sat, 26 Sep 2020 08:31:55 +0800 Subject: [PATCH 3/3] Mention iter vec documentation return ok --- library/alloc/src/vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index 4ec41a5bade6f..4050f7a756be5 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -570,7 +570,7 @@ impl Vec { /// Tries to reserve the minimum capacity for exactly `additional` /// elements to be inserted in the given `Vec`. After calling /// `try_reserve_exact`, capacity will be greater than or equal to - /// `self.len() + additional`. + /// `self.len() + additional` if it returns `Ok(())`. /// Does nothing if the capacity is already sufficient. /// /// Note that the allocator may give the collection more space than it