Skip to content

Add rotate, partition, and friends to vectors #11320

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

Closed
wants to merge 5 commits into from
Closed

Add rotate, partition, and friends to vectors #11320

wants to merge 5 commits into from

Conversation

pongad
Copy link
Contributor

@pongad pongad commented Jan 5, 2014

Propose to add rotate, is_partitioned, partition, and partition_stable to vectors. All methods act like STL functions of the same name, but they work on vectors, instead of iterators.

@@ -1017,6 +1017,17 @@ pub trait ImmutableVector<'a, T> {
* Fails if slice is empty.
*/
fn pop_ref(&mut self) -> &'a T;

/**
* Returns true if all the elements in vector
Copy link
Member

Choose a reason for hiding this comment

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

This sentence seems to be line-wrapped weirdly.

(Also, we are (slowly) moving to just using /// for doc comments, i.e.

/// Returns true if all the elements in vector
/// for which pred returns true precede those for which it returns false.
///
/// ...
fn is_partititioned(...)

@pongad pongad closed this Jan 8, 2014
@pongad pongad deleted the addparti branch January 8, 2014 00:30
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 11, 2023
…_mutated, r=Alexendoo

redundant_locals: fix FPs on mutated shadows

Fixes rust-lang#11290.

When a mutable binding is shadowed by
a mutable binding of the same name in a different scope, mutations in that scope have different meaning.
This PR fixes spurious `redundant_locals` emissions on such locals.

cc `@Centri3,` `@flip1995`

changelog: [`redundant_locals`]: fix false positives on mutated shadows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants