rust-lang/rust — pull request #15647 by nham (2014-07-13 17:40:31+00:00)
Title: Implement Hash for HashMap and HashSet and PartialOrd for HashSet

cc #15294

Does it make sense to just implement PartialOrd for every type that implements Set? There is a well-defined partial ordering on sets based on set inclusion. I'm thinking something like this:

impl> PartialOrd for S {
fn partial_cmp(&self, other: &S) -> Option {
match (self.is_subset(other), other.is_subset(&self)) {
(true, true) => Some(Equal),
(true, false) => Some(Less),
(false, true) => Some(Greater),
(false, false) => None
}
}
}