-
Notifications
You must be signed in to change notification settings - Fork 114
Open
Description
This behavior was quite surprising to me:
use im::{hashset};
fn main() {
let hs1 = hashset![1, 2, 3];
let hs2 = hashset![3, 2, 1];
println!("{}", hs1 == hs2);
let hshs = hashset![hs1, hs2];
println!("{:?}", hshs.len());
}Output:
true
2
I had expected the length of hshs to be one, since hs1 is equal to hs2.
I am not sure if this is an error in HashSet's Hash implementation (e.g., hs1 == hs2 but h(hs1) != h(hs2)) or me misunderstanding the semantics of HashSet.
Metadata
Metadata
Assignees
Labels
No labels