-
Notifications
You must be signed in to change notification settings - Fork 3
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 SecondaryMap for HashSet #62
Conversation
if HashSet::contains(self, &key) { | ||
&true | ||
} else { | ||
&false | ||
} |
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.
if HashSet::contains(self, &key) { | |
&true | |
} else { | |
&false | |
} | |
&HashSet::contains(self, &key) |
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.
Annoyingly we cannot do that, because the return value of HashSet::contains(self, &key)
is a local variable, where true
and false
can be statically defined :/
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.
that is quite funny
src/secondary.rs
Outdated
} | ||
|
||
#[inline] | ||
fn resize(&mut self, _new_len: usize) {} |
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.
not sure I follow why this is empty
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 method was meant to truncate the linear vecs in Unmanaged map and BitVec, but that doesn't make sense on sparse unordered containers.
It should probably be removed from the trait (it's never used).
Extracted from #60. Partially implements #55.
The HashMap is a lot more tricky due to having to return references to a generic default value.