#declarative-macro #collection #macro #hash-map #hash-set #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

#263 in Data structures

Download history 638/week @ 2024-01-25 612/week @ 2024-02-01 468/week @ 2024-02-08 624/week @ 2024-02-15 647/week @ 2024-02-22 921/week @ 2024-02-29 952/week @ 2024-03-07 861/week @ 2024-03-14 930/week @ 2024-03-21 974/week @ 2024-03-28 1185/week @ 2024-04-04 1127/week @ 2024-04-11 853/week @ 2024-04-18 1149/week @ 2024-04-25 1327/week @ 2024-05-02 675/week @ 2024-05-09

4,234 downloads per month
Used in 13 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