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 Itertools.contains #514

Merged
merged 9 commits into from Jan 13, 2021
Merged

Add Itertools.contains #514

merged 9 commits into from Jan 13, 2021

Conversation

mmirate
Copy link
Contributor

@mmirate mmirate commented Jan 10, 2021

This is an extremely trivial shorthand for the code-pattern suggested by the docs for slice::contains in the case when one has a slice of owned data to be queried using borrowed data.

@jswrenn jswrenn added this to the next milestone Jan 10, 2021
@phimuemue
Copy link
Member

Should we also support Borrow? - Like e.g. HashSet::get, so that we can test if an iterator over Strings contains a &str.

@mmirate
Copy link
Contributor Author

mmirate commented Jan 10, 2021

Should we also support Borrow? - Like e.g. HashSet::get, so that we can test if an iterator over Strings contains a &str.

I believe I included an example of this in the doctests.

Copy link
Member

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
Co-authored-by: Jack Wrenn <me@jswrenn.com>
src/lib.rs Outdated Show resolved Hide resolved
Co-authored-by: Jack Wrenn <me@jswrenn.com>
src/lib.rs Outdated Show resolved Hide resolved
Co-authored-by: Jack Wrenn <me@jswrenn.com>
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
mmirate and others added 3 commits January 10, 2021 14:21
Co-authored-by: Jack Wrenn <me@jswrenn.com>
@mmirate
Copy link
Contributor Author

mmirate commented Jan 10, 2021

That seems to be the last of the typos and such. I hate to think how far they would have gone in a dynamic language. 😃

@mmirate mmirate requested a review from jswrenn January 11, 2021 00:12
Copy link
Member

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

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

Thanks for this!

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 13, 2021

Build succeeded:

@bors bors bot merged commit cc46647 into rust-itertools:master Jan 13, 2021
@mmirate
Copy link
Contributor Author

mmirate commented Jan 13, 2021

My pleasure. :)

@mmirate mmirate deleted the mmirate-patch-1 branch August 30, 2021 14:20
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.

None yet

3 participants