Skip to content

Add contains to VecDeque and LinkedList (+ tests) - #32951

Merged
bors merged 1 commit into
rust-lang:masterfrom
LukasKalbertodt:collection_contains_rfc1552
Apr 20, 2016
Merged

bors merged 1 commit into
rust-lang:masterfrom
LukasKalbertodt:collection_contains_rfc1552

Conversation

@LukasKalbertodt

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor 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

brson commented Apr 20, 2016

Copy link
Copy Markdown
Contributor

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

@bors r+

@bors

bors commented Apr 20, 2016

Copy link
Copy Markdown
Contributor

📌 Commit bf3aefe has been approved by brson

@brson

brson commented Apr 20, 2016

Copy link
Copy Markdown
Contributor

Thanks @LukasKalbertodt

@bors

bors commented Apr 20, 2016

Copy link
Copy Markdown
Contributor

⌛ 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