-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add contains
to VecDeque
and LinkedList
(+ tests)
#32951
Conversation
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. |
This could be generalized as fn contains<U: ?Sized>(&self, x: &U) -> bool where T: PartialEq<U> // or `U: PartialEq<T>` |
Oh right... I did it exactly as specified in the RFC. That's the way it's done for Right now, I can't think of any reasons not to do it like you suggested 😕 |
Seems like we should define it as the precedent and RFC state for now. @bors r+ |
📌 Commit bf3aefe has been approved by |
Thanks @LukasKalbertodt |
…=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!
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!