From 2ad52cd16d9535383bfabaf47a56bf80858b91b0 Mon Sep 17 00:00:00 2001 From: Youngsuk Kim Date: Fri, 28 Feb 2020 19:28:26 -0500 Subject: [PATCH 1/3] Clarify explanation of 'fn resize' 1. Clarified on what should implement 'Clone' trait. 2. Minor grammar fix: to be able clone => to be able to clone --- src/liballoc/vec.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 29987ac44e6..bcbf931d162 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1472,8 +1472,9 @@ impl Vec { /// difference, with each additional slot filled with `value`. /// If `new_len` is less than `len`, the `Vec` is simply truncated. /// - /// This method requires [`Clone`] to be able clone the passed value. If - /// you need more flexibility (or want to rely on [`Default`] instead of + /// This method requires `value` to implement [`Clone`], + /// in order to be able to clone the passed value. + /// If you need more flexibility (or want to rely on [`Default`] instead of /// [`Clone`]), use [`resize_with`]. /// /// # Examples From fb46d2b82e9d2cf6b9916b533dafb6b29857eaec Mon Sep 17 00:00:00 2001 From: Youngsuk Kim Date: Sat, 29 Feb 2020 00:52:32 -0500 Subject: [PATCH 2/3] Update src/liballoc/vec.rs Following suggestion from @jonas-schievink Co-Authored-By: Jonas Schievink --- src/liballoc/vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index bcbf931d162..7a0c2c264bf 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1472,7 +1472,7 @@ impl Vec { /// difference, with each additional slot filled with `value`. /// If `new_len` is less than `len`, the `Vec` is simply truncated. /// - /// This method requires `value` to implement [`Clone`], + /// This method requires `T` to implement [`Clone`], /// in order to be able to clone the passed value. /// If you need more flexibility (or want to rely on [`Default`] instead of /// [`Clone`]), use [`resize_with`]. From 6e265c5bc58ddf830445054907c69369d6b84162 Mon Sep 17 00:00:00 2001 From: Youngsuk Kim Date: Sat, 29 Feb 2020 00:55:05 -0500 Subject: [PATCH 3/3] Remove trailing whitespace Removed trailing whitespace which caused to fail pretty-check --- src/liballoc/vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 7a0c2c264bf..55b313a9032 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1472,7 +1472,7 @@ impl Vec { /// difference, with each additional slot filled with `value`. /// If `new_len` is less than `len`, the `Vec` is simply truncated. /// - /// This method requires `T` to implement [`Clone`], + /// This method requires `T` to implement [`Clone`], /// in order to be able to clone the passed value. /// If you need more flexibility (or want to rely on [`Default`] instead of /// [`Clone`]), use [`resize_with`].