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

Implement List's all() function #12160

Closed
wants to merge 1 commit into from
Closed

Implement List's all() function #12160

wants to merge 1 commit into from

Conversation

brunoabinader
Copy link
Contributor

As opposed to any(), all() returns true if all list items matches the predicate, returning false otherwise.

@alexcrichton
Copy link
Member

If we continue to go down this road, then the real answer here is to define an iterator for the List type, could you look into doing this?

@brunoabinader
Copy link
Contributor Author

Yeah :-)

@lilyball
Copy link
Contributor

If we're going to go down that route, the whole API needs to be revisited. All these free functions should probably be methods.

@brunoabinader
Copy link
Contributor Author

Right - do we update this now or let it for a further patch?

@alexcrichton
Copy link
Member

I think let's close this for now, but feel free to open another PR with an iterator-based approach.

@flaper87
Copy link
Contributor

IMHO, it's time to revisit the API as @kballard said. I'd prefer doing that instead of adding more methods to it.

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2022
minor: Sort ide-completions test outputs for less disruptive diffs
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 8, 2024
…lyxyas

Warn if an item coming from more recent version than MSRV is used

Part of rust-lang/rust-clippy#6324.

~~Currently, the lint is not working for the simple reason that the `stable` attribute is not kept in dependencies. I'll send a PR to rustc to see if they'd be okay with keeping it.~~

EDIT: There was actually a `lookup_stability` function providing this information, so all good now!

cc `@epage`

changelog: create new [`incompatible_msrv`] lint
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