-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(hash_map_macro)]
This is a tracking issue for rust-lang/libs-team#578
The hash_map!
macro is like the vec!
macro but for HashMap
s, it aims to help create hash_maps with set keys for functions that require dynamic key value pairs such as a templating engine asking to fill the templates with a HashMap
.
Public API
use std::hash_map;
fn main() {
let map = hash_map![
"key" => "value",
"key2" => "value2"
]; // uses type inference.
for (key, value) in map {
println!("{key:?} => {value:?}");
}
}
Steps / History
(Remember to update the S-tracking-*
label when checking boxes.)
- Implementation: Implement
hash_map
macro #144070 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- What separator should we use? the main proposition was
=>
,:
was also proposed.
Footnotes
Andras-Csanyi, chikof and Kobzol
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.