-
Notifications
You must be signed in to change notification settings - Fork 13k
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
#31262 add a public hasher function for HashSet and HashMap #31357
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
/// Returns the hasher that is used or the detault hasher if none is | ||
/// specified. | ||
#[inline] | ||
#[stable(feature = "hashmap_build_hasher", since = "1.7.0")] |
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.
Why is this stable, but the corresponding method for HashMap
unstable?
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.
Sorry, should have been stable. Fixed.
@@ -642,6 +642,14 @@ impl<K, V, S> HashMap<K, V, S> | |||
HashMap::with_capacity_and_hasher(capacity, hash_state) | |||
} | |||
|
|||
/// Returns the hasher that is used or the default hasher if none is |
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.
I think this would be better as something like:
Returns a reference to the map's hasher.
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.
Done.
CC @rust-lang/libs |
@@ -642,6 +642,13 @@ impl<K, V, S> HashMap<K, V, S> | |||
HashMap::with_capacity_and_hasher(capacity, hash_state) | |||
} | |||
|
|||
/// Returns a reference to the maps hasher. |
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.
map's
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.
Fixed.
I don't believe we want to make this functionality insta-stable? Probably want to introduce a new feature for this. Edit: I may be wrong though, it's |
CC #31262 |
I second this, |
@pnkfelix yep - just updated the issue and will push the PR when tests complete. |
@rthomas Thanks! Could you squash these commits? |
The libs team discussed this during triage today and the conclusion was that this is good to go. As well as squashing like @apasel422 mentioned, could you also remove the Other than that looks good to me, thanks for the PR @rthomas! |
Thanks @apasel422 and @alexcrichton, I've removed the |
add a public hasher function for HashSet and HashMap
add a public hasher function for HashSet and HashMap