Rewrite/expand doc examples for Vec::set_len.#34911
Conversation
src/libcollections/vec.rs
Outdated
There was a problem hiding this comment.
idiom is to import the module, so just std::ptr...
|
I have a bunch of teeny nitpicks, but this is great! Thanks so much. r=me after they're fixed |
231227b to
102419a
Compare
|
Comments have been addressed. Thanks for the review! |
|
@bors: r+ rollup thanks so much!!! |
|
📌 Commit 102419a has been approved by |
|
|
Changes made: @@ -538,7 +554,7 @@ impl<T> Vec<T> {
///
/// unsafe {
/// ptr::drop_in_place(&mut vec[3]);
- /// v.set_len(3);
+ /// vec.set_len(3);
/// }
/// assert_eq!(vec, ['r', 'u', 's']);
/// ```@@ -559,7 +575,7 @@ impl<T> Vec<T> {
/// values of unallocated memory:
///
/// ```
- /// let mut vec = Vec::new();
+ /// let mut vec: Vec<char> = Vec::new();
///
/// unsafe {
/// vec.set_len(4); |
|
ah, nice catch. @bors: r+ rollup |
|
📌 Commit a005b2c has been approved by |
|
⌛ Testing commit a005b2c with merge afaaf4b... |
|
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
|
@bors: retry On Tue, Jul 19, 2016 at 10:01 PM, bors notifications@github.com wrote:
|
|
⌛ Testing commit a005b2c with merge 3dcdb53... |
|
💔 Test failed - auto-linux-64-cargotest |
|
@bors: retry On Wed, Jul 20, 2016 at 6:27 PM, bors notifications@github.com wrote:
|
Rewrite/expand doc examples for `Vec::set_len`. None
Example was written in rust-lang#34911 Issue was brought up in this comment: rust-lang@a005b2c#commitcomment-18346958
…=nagisa Fix incorrect 'memory leak' example for `Vec::set_len`. Example was written in rust-lang#34911 Issue was brought up in this comment: rust-lang@a005b2c#commitcomment-18346958
No description provided.