Skip to content
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

add is_sorted, is_sorted_by, is_sorted_by_key #261

Closed
wants to merge 4 commits into from

Conversation

gnzlbg
Copy link

@gnzlbg gnzlbg commented Feb 5, 2018

No description provided.

@gnzlbg
Copy link
Author

gnzlbg commented Feb 5, 2018

@bluss looks like rand made a breaking change but did not bump the major semver version :(

src/lib.rs Outdated
if let Some(mut first) = first {
while let Some(second) = self.next() {
if compare(&first, &second) == Ordering::Greater {
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

For a while-let with an early return, should this be &mut self instead, like all and any?

(nit: can it be written in terms of all, until try_fold is stable?)

Copy link
Author

Choose a reason for hiding this comment

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

I'll give these a try!

Copy link
Author

Choose a reason for hiding this comment

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

@scottmcm these should be fixed now

@gnzlbg
Copy link
Author

gnzlbg commented Feb 6, 2018

@scottmcm probably the solution to fixing the travis bots is to raise the minimum version of stable supported, or to disable tests that don't work on the stable version used. Bumping the minimum version of stable supported will require a major semver bump though (0.7 to 0.8).

@bluss
Copy link
Member

bluss commented Feb 6, 2018

sad to see rand breaking that

@bluss
Copy link
Member

bluss commented Feb 6, 2018

Hi, it looks good. Please place these new methods in the regular method section. For example after the sorted methods.

@gnzlbg
Copy link
Author

gnzlbg commented Feb 6, 2018

I've moved the methods. Is that place ok? I did not realize the methods were separated into sections :/

@bluss
Copy link
Member

bluss commented Feb 6, 2018

It's in the Itertools trait doc, but it's impossible to see that doc due to the big ugly code block that starts a trait documentation page.

@bluss
Copy link
Member

bluss commented Feb 6, 2018

The trait Itertools: extra iterator adaptors and methods for iterators.

This trait defines a number of methods. They are divided into two groups:

Adaptors take an iterator and parameter as input, and return a new iterator value. These are listed first in the trait. An example of an adaptor is .interleave()

Regular methods are those that don't return iterators and instead return a regular value of some other kind. .next_tuple() is an example and the first regular method in the list.

@bluss
Copy link
Member

bluss commented Mar 4, 2018

Thanks. We need to see how the discussion for std is going. As witnessed with the flatten problems, it would suck to introduce these here only to have them in std shortly afterwards.

@gnzlbg
Copy link
Author

gnzlbg commented Mar 4, 2018 via email

@bluss
Copy link
Member

bluss commented Nov 24, 2018

Superseded by work in std, rust-lang/rust/pull/55045

@bluss bluss closed this Nov 24, 2018
@oxalica
Copy link

oxalica commented May 23, 2023

Superseded by work in std, rust-lang/rust/pull/55045

It's 2 years but still not stable. Couldn't we also impl these methods in itertools as stable alternatives?

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.

4 participants