-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Implement hash_map
macro
#144070
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
base: master
Are you sure you want to change the base?
Implement hash_map
macro
#144070
Conversation
This comment has been minimized.
This comment has been minimized.
3d020f6
to
b5692af
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Wouldn't using one of |
I was thinking about
|
All the options i mentioned should be equivalent to let len = 1 $(+ {stringify!($k); 1})*;
let mut map = HashMap::with_capacity(len);
$( map.insert($k, $v); )* HashMap::from([$(($k, $v)),*]) |
Implementation of #144032
Implements the
hash_map
macro understd/src/macros.rs
.