#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

#291 in Data structures

Download history 860/week @ 2024-08-15 856/week @ 2024-08-22 1175/week @ 2024-08-29 1742/week @ 2024-09-05 1520/week @ 2024-09-12 1773/week @ 2024-09-19 2097/week @ 2024-09-26 1946/week @ 2024-10-03 2355/week @ 2024-10-10 2130/week @ 2024-10-17 1895/week @ 2024-10-24 1832/week @ 2024-10-31 2043/week @ 2024-11-07 2336/week @ 2024-11-14 2279/week @ 2024-11-21 1630/week @ 2024-11-28

8,532 downloads per month
Used in 26 crates (16 directly)

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