-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix many collections implementing PartialEq #14734
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
Conversation
They now properly check each element with the `eq` and `ne` methods in their own `eq` and `ne` method, respectively.
See also #14733. |
} | ||
fn ne(&self, other: &RingBuf<A>) -> bool { | ||
!self.eq(other) | ||
self.nelts != other.nelts && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The && should be an ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it should be any
instead of all
.
With #14733 this will only be needed for consistency. |
Would it be possible to add tests for this functionality? This seems very easy to get wrong during a refactoring. |
I don't think this is necessary now that we guarantee that == and != are inverses. |
@alexcrichton @sfackler |
Yes |
Closing due to inactivity, but feel free to reopen with a rebase! |
They now properly check each element with the
eq
andne
methods in theirown
eq
andne
method, respectively.