Uh oh!
There was an error while loading. Please reload this page.
Explained the difference between ownership iteration and reference iteration - #32002
Conversation
rust-highfive
commented
Mar 2, 2016
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
| println!("Take ownership of the vector and its element {}", i); | ||
| } | ||
| ``` | ||
| Note: You cannot use the vector again once you have iterated with ownership of the vector. |
There was a problem hiding this comment.
iterated by taking ownership of the vector
There was a problem hiding this comment.
(Also, please put a newline above this line as well)
steveklabnik
commented
Mar 2, 2016
Thanks so much @srinivasreddy ! I like @Manishearth 's grammar suggestions, and I have some whitespace ones as well. We're good to go after that's fixed up! |
srinivasreddy
commented
Mar 2, 2016
@steveklabnik Welcome!! @Manishearth Please review and merge |
| } | ||
| for i in &v { | ||
| println!("This is a reference {}", i); |
There was a problem hiding this comment.
make this text match the previous
srinivasreddy
commented
Mar 2, 2016
@Manishearth Done |
Manishearth
commented
Mar 2, 2016
@bors r+ rollup |
bors
commented
Mar 2, 2016
📌 Commit 2dc723d has been approved by |
Manishearth
commented
Mar 2, 2016
Thanks! |
srinivasreddy
commented
Mar 3, 2016
@Manishearth I am new to travis. Do you see any reason for build failure? Could you please help me ? |
| You can iterate the vector multiple times by taking a reference to the vector whilst iterating. | ||
| For example, the following code does not compile. | ||
| ```rust |
There was a problem hiding this comment.
you need to have rust,ignore here
Manishearth
commented
Mar 3, 2016
Ah, in this case the doctest failed. Rust code in documentation is compiled and run as a test, so your example of failing code should be annotated as mentioned above to skip this. |
bors
commented
Mar 3, 2016
⌛ Testing commit 2dc723d with merge 02c4cb5... |
bors
commented
Mar 3, 2016
💔 Test failed - auto-linux-64-opt |
Manishearth
commented
Mar 3, 2016
@bors r+ rollup |
bors
commented
Mar 3, 2016
📌 Commit d2df551 has been approved by |
srinivasreddy
commented
Mar 4, 2016
@Manishearth Please merge. Or could @bors automatically merge this? |
Manishearth
commented
Mar 4, 2016
Yes. Bors will run tests on the CI and automatically merge if they pass, like last time. |
Manishearth
commented
Mar 4, 2016
There's a queue (http://buildbot.rust-lang.org/homu/queue/rust), so it might take some time for your PR to get merged. |
Issue here : #31991