Skip to content

hashmap macro for creating hashmap from provided key/value pairs

License

Notifications You must be signed in to change notification settings

wholesome-ghoul/hashmap_macro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HashMap Macro

Creates a HashMap from provided key/value pairs.

Usage

use std::collections::HashMap;
use hashmap_macro::hashmap;

let m: HashMap<&str, u32> = hashmap![];
let m: HashMap<&str, u32> = hashmap!("a" => 1);
let m: HashMap<&str, u32> = hashmap! {
    "a" => 1,
    "b" => 2,
};

Inspired by Jon Gjengset's Crust of Rust: Declarative Macros

About

hashmap macro for creating hashmap from provided key/value pairs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages