-
Notifications
You must be signed in to change notification settings - Fork 90
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
implement Eq and Hash for some immut types #1215
Conversation
Observed Problems and Suggestions
By addressing these issues, the code will be more concise, maintainable, and potentially more efficient. |
Pull Request Test Coverage Report for Build 3871Details
💛 - Coveralls |
///| | ||
pub impl[A : Compare] Eq for T[A] with op_equal(self, other) { | ||
self.length() == other.length() && self.to_array() == other.to_array() | ||
} |
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.
FTR, performance wise, this may be improved in the future
@@ -22,6 +22,8 @@ impl T { | |||
to_string[A : Show + Compare + Eq](Self[A]) -> String | |||
unsafe_pop[A : Compare + Eq](Self[A]) -> Self[A] | |||
} | |||
impl[A : Compare + Eq] Eq for T[A] | |||
impl[A : Hash + Compare + Eq] Hash for T[A] | |||
impl[A : Show + Compare + Eq] Show for T[A] |
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.
cc @lynzrand this is redundant, given Compare: Eq
Related issue: #1177