-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Expose get_many_mut
and get_many_unchecked_mut
to HashMap
#94647
Conversation
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
r? @thomcc |
Err, didn't mean to close. |
Since I was asked in the other PR, I'll take this one. r? @thomcc |
This is an API change, so it should go to T-libs-api. r? rust-lang/libs-api @rustbot label +T-libs-api -T-libs |
CC @Amanieu |
There was some discussion in hashbrown about allowing a variable slice instead of an array: rust-lang/hashbrown#332 However I don't think this is immediately relevant since this is still unstable. |
@Amanieu Since you know the API and underline hashbrown code, could you take over this (small) review ? |
LGTM. Can you create a tracking issue and refer to it in the code? |
@bors r+ |
📌 Commit 0a6001b has been approved by |
Expose `get_many_mut` and `get_many_unchecked_mut` to HashMap This pull-request expose the function [`get_many_mut`](https://docs.rs/hashbrown/0.12.0/hashbrown/struct.HashMap.html#method.get_many_mut) and [`get_many_unchecked_mut`](https://docs.rs/hashbrown/0.12.0/hashbrown/struct.HashMap.html#method.get_many_unchecked_mut) from `hashbrown` to the standard library `HashMap` type. They obviously keep the same API and are added under the (new) `map_many_mut` feature. - `get_many_mut`: Attempts to get mutable references to `N` values in the map at once. - `get_many_unchecked_mut`: Attempts to get mutable references to `N` values in the map at once, without validating that the values are unique.
Rollup of 9 pull requests Successful merges: - rust-lang#94647 (Expose `get_many_mut` and `get_many_unchecked_mut` to HashMap) - rust-lang#97216 (Ensure we never consider the null pointer dereferencable) - rust-lang#97399 (simplify code of finding arg index in `opt_const_param_of`) - rust-lang#97470 (rustdoc: add more test coverage) - rust-lang#97498 (Corrected EBNF grammar for from_str) - rust-lang#97562 (Fix comment in `poly_project_and_unify_type`) - rust-lang#97580 (Add regression test for rust-lang#71546) - rust-lang#97611 (Tweak insert docs) - rust-lang#97616 (Remove an unnecessary `Option`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Expose `get_many_mut` and `get_many_unchecked_mut` to HashMap This pull-request expose the function [`get_many_mut`](https://docs.rs/hashbrown/0.12.0/hashbrown/struct.HashMap.html#method.get_many_mut) and [`get_many_unchecked_mut`](https://docs.rs/hashbrown/0.12.0/hashbrown/struct.HashMap.html#method.get_many_unchecked_mut) from `hashbrown` to the standard library `HashMap` type. They obviously keep the same API and are added under the (new) `map_many_mut` feature. - `get_many_mut`: Attempts to get mutable references to `N` values in the map at once. - `get_many_unchecked_mut`: Attempts to get mutable references to `N` values in the map at once, without validating that the values are unique.
This pull-request expose the function
get_many_mut
andget_many_unchecked_mut
fromhashbrown
to the standard libraryHashMap
type. They obviously keep the same API and are added under the (new)map_many_mut
feature.get_many_mut
: Attempts to get mutable references toN
values in the map at once.get_many_unchecked_mut
: Attempts to get mutable references toN
values in the map at once, without validating that the values are unique.