-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 into_keys
and into_values
for associative maps
#75163
Conversation
4a7a49d
to
c2c7b37
Compare
…oKeys and IntoValues
c2c7b37
to
16a5217
Compare
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.
Thanks, this looks good to me once the IntoValues min and max are fixed. Please also file a tracking issue (separate from the original "feature request" issue) and update the unstable
attribute issue numbers in the PR.
Thanks for the review! Filed #75294 as the tracking issue and and change the old number to the new in the patch (added two more commits to address them). |
/// use std::collections::HashMap; | ||
/// | ||
/// let mut map = HashMap::new(); | ||
/// map.insert("a", 1); |
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.
Perhaps it's better an example with HashMap<String>
instead of HashMap<&str>
?
@bors r+ |
📌 Commit 4cd2637 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
@@ -1,3 +1,5 @@ | |||
// ignore-tidy-filelength |
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 IntoKeys
and impls should be moved to a module file to remove this tidy ignore.
This is pretty much a direct copy of rust-lang/rust#75163, aligning the hashbrown API with current std API.
This is pretty much a direct copy of rust-lang/rust#75163, aligning the hashbrown API with current std API.
Add into_keys and into_values to HashMap. This is pretty much a direct copy of rust-lang/rust#75163, aligning the hashbrown API with current std API.
This PR implements
into_keys
andinto_values
for HashMap and BTreeMap types. They are implemented as unstable, undermap_into_keys_values
feature.Fixes #55214.
r? @dtolnay