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 contains to VecDeque and LinkedList (+ tests) #32951

Merged
merged 1 commit into from
Apr 20, 2016

Conversation

LukasKalbertodt
Copy link
Member

This implements RFC 1552. Tracking issue: #32630

Sorry for the late response. This is my first contribution, so please tell me if anything isn't optimal!

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@apasel422
Copy link
Contributor

This could be generalized as

fn contains<U: ?Sized>(&self, x: &U) -> bool where T: PartialEq<U> // or `U: PartialEq<T>`

@LukasKalbertodt
Copy link
Member Author

Oh right... I did it exactly as specified in the RFC. That's the way it's done for [T]::contains...

Right now, I can't think of any reasons not to do it like you suggested 😕

@brson
Copy link
Contributor

brson commented Apr 20, 2016

Seems like we should define it as the precedent and RFC state for now.

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 20, 2016

📌 Commit bf3aefe has been approved by brson

@brson
Copy link
Contributor

brson commented Apr 20, 2016

Thanks @LukasKalbertodt

@bors
Copy link
Collaborator

bors commented Apr 20, 2016

⌛ Testing commit bf3aefe with merge 133f60f...

bors added a commit that referenced this pull request Apr 20, 2016
…=brson

Add `contains` to `VecDeque` and `LinkedList` (+ tests)

This implements [RFC 1552](https://github.com/rust-lang/rfcs/blob/master/text/1552-contains-method-for-various-collections.md). Tracking issue: #32630

Sorry for the late response. This is my first contribution, so please tell me if anything isn't optimal!
@bors bors merged commit bf3aefe into rust-lang:master Apr 20, 2016
@LukasKalbertodt LukasKalbertodt deleted the collection_contains_rfc1552 branch May 3, 2020 16:11
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.

5 participants