#macro #hash-map #hash-set #collections #vec

no-std map-macro

Declarative macros for statically initializing collections

9 releases

0.3.0 Jan 29, 2024
0.2.6 Apr 22, 2023
0.2.5 Dec 15, 2022
0.2.4 Aug 18, 2022
0.1.0 May 11, 2021

#181 in Data structures

Download history 988/week @ 2023-11-03 1113/week @ 2023-11-10 962/week @ 2023-11-17 913/week @ 2023-11-24 773/week @ 2023-12-01 822/week @ 2023-12-08 1164/week @ 2023-12-15 711/week @ 2023-12-22 643/week @ 2023-12-29 860/week @ 2024-01-05 801/week @ 2024-01-12 647/week @ 2024-01-19 777/week @ 2024-01-26 741/week @ 2024-02-02 604/week @ 2024-02-09 677/week @ 2024-02-16

2,891 downloads per month
Used in 10 crates

MIT license

26KB
216 lines

map-macro

Build Status Latest Version Downloads Docs License: MIT

This crate offers declarative macros for initializing collections from the standard library and hashbrown.

This crate has zero dependencies and is #![no_std] if you opt-out of support for the standard library collections.

Example

use map_macro::hash_map;

let hello = hash_map! {
    "en" => "Hello",
    "de" => "Hallo",
    "fr" => "Bonjour",
    "es" => "Hola",
    "cat" => "Hola",
    "🌍" => "👋",
};

Dependencies