about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-02-28 07:26:30 -0800
committerbors <bors@rust-lang.org>2014-02-28 07:26:30 -0800
commit9b1be3d182e361697117bf79fadca7697f8b5aec (patch)
tree1d71e7d29a65010e05e6fd91ef25965c4da2fd4c /src/libstd
parent2e51e8d926625187226e2e37381b9ea671e18a48 (diff)
parentdaa6da766aabd27edc0011cacdb15a88971c9da8 (diff)
downloadrust-9b1be3d182e361697117bf79fadca7697f8b5aec.tar.gz
rust-9b1be3d182e361697117bf79fadca7697f8b5aec.zip
auto merge of #12622 : pnkfelix/rust/fsk-improve-vec-partition-doc, r=huonw
Explicitly note in vec `partition` and `partitioned` that the left and
right parts each map to satisfying and non-satisfying elements.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/vec.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index ce719c6d0b8..fba3538db83 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -1223,10 +1223,8 @@ impl<'a, T: TotalOrd> ImmutableTotalOrdVector<T> for &'a [T] {
 
 /// Extension methods for vectors containing `Clone` elements.
 pub trait ImmutableCloneableVector<T> {
-    /**
-     * Partitions the vector into those that satisfies the predicate, and
-     * those that do not.
-     */
+    /// Partitions the vector into two vectors `(A,B)`, where all
+    /// elements of `A` satisfy `f` and all elements of `B` do not.
     fn partitioned(&self, f: |&T| -> bool) -> (~[T], ~[T]);
 
     /// Create an iterator that yields every possible permutation of the
@@ -1394,9 +1392,10 @@ pub trait OwnedVector<T> {
      * Like `filter()`, but in place.  Preserves order of `v`.  Linear time.
      */
     fn retain(&mut self, f: |t: &T| -> bool);
+
     /**
-     * Partitions the vector into those that satisfies the predicate, and
-     * those that do not.
+     * Partitions the vector into two vectors `(A,B)`, where all
+     * elements of `A` satisfy `f` and all elements of `B` do not.
      */
     fn partition(self, f: |&T| -> bool) -> (~[T], ~[T]);