Skip to content

Improve vec partition and partitioned method doc. #12622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/libstd/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason for not making this one into ///?

(r=me if you do change it)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation in the immediate area was using /** ... */. Well, at least the immediately preceding and succeeding items are using /** ... */ Anyway, I figured when the world is inconsistent, then just leave the global change to one convention to a later ticket.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds fine.

* elements of `A` satisfy `f` and all elements of `B` do not.
*/
fn partition(self, f: |&T| -> bool) -> (~[T], ~[T]);

Expand Down