about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-04-05 12:44:33 -0400
committerGitHub <noreply@github.com>2017-04-05 12:44:33 -0400
commit5935fe47a9cf95b4577cad2efb5cddcd5d2b3e04 (patch)
treea622f4946f2008d4ff9c1666d075f102b1ab2c19
parent56b68305279059e0ff25f87a46e6fa5013a26ae3 (diff)
parent5787808d07b27d12a397cd20bd630a2ed1f35ca2 (diff)
downloadrust-5935fe47a9cf95b4577cad2efb5cddcd5d2b3e04.tar.gz
rust-5935fe47a9cf95b4577cad2efb5cddcd5d2b3e04.zip
Rollup merge of #41019 - mandeep:fix-vec-swapremove-docs, r=BurntSushi
Fixed typo in doc comments for swap_remove

While reading the Vec docs, I came across the docs for swap_remove. I believe there is a typo in the comment and ```return``` should be ```returns```. This PR fixes this issue.

I also feel that the entire doc comment is a bit of a run-on and could be changed to something along the lines of ```Removes an element from anywhere in the vector and returns it. The vector is mutated and the removed element is replaced by the last element of the vector. ```

Thoughts?
-rw-r--r--src/libcollections/vec.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index 56b60a3e003..be613e06b02 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -678,8 +678,9 @@ impl<T> Vec<T> {
         self.len = len;
     }
 
-    /// Removes an element from anywhere in the vector and return it, replacing
-    /// it with the last element.
+    /// Removes an element from the vector and returns it.
+    ///
+    /// The removed element is replaced by the last element of the vector.
     ///
     /// This does not preserve ordering, but is O(1).
     ///