Skip to content

Commit 9b1be3d

Browse files
committed
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.
2 parents 2e51e8d + daa6da7 commit 9b1be3d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/libstd/vec.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,10 +1223,8 @@ impl<'a, T: TotalOrd> ImmutableTotalOrdVector<T> for &'a [T] {
12231223

12241224
/// Extension methods for vectors containing `Clone` elements.
12251225
pub trait ImmutableCloneableVector<T> {
1226-
/**
1227-
* Partitions the vector into those that satisfies the predicate, and
1228-
* those that do not.
1229-
*/
1226+
/// Partitions the vector into two vectors `(A,B)`, where all
1227+
/// elements of `A` satisfy `f` and all elements of `B` do not.
12301228
fn partitioned(&self, f: |&T| -> bool) -> (~[T], ~[T]);
12311229

12321230
/// Create an iterator that yields every possible permutation of the
@@ -1394,9 +1392,10 @@ pub trait OwnedVector<T> {
13941392
* Like `filter()`, but in place. Preserves order of `v`. Linear time.
13951393
*/
13961394
fn retain(&mut self, f: |t: &T| -> bool);
1395+
13971396
/**
1398-
* Partitions the vector into those that satisfies the predicate, and
1399-
* those that do not.
1397+
* Partitions the vector into two vectors `(A,B)`, where all
1398+
* elements of `A` satisfy `f` and all elements of `B` do not.
14001399
*/
14011400
fn partition(self, f: |&T| -> bool) -> (~[T], ~[T]);
14021401

0 commit comments

Comments
 (0)