#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

#376 in Data structures

Download history 1457/week @ 2024-09-13 1910/week @ 2024-09-20 2061/week @ 2024-09-27 2116/week @ 2024-10-04 2408/week @ 2024-10-11 1824/week @ 2024-10-18 1920/week @ 2024-10-25 1915/week @ 2024-11-01 1968/week @ 2024-11-08 2409/week @ 2024-11-15 2267/week @ 2024-11-22 2058/week @ 2024-11-29 1861/week @ 2024-12-06 1531/week @ 2024-12-13 1449/week @ 2024-12-20 1161/week @ 2024-12-27

6,378 downloads per month
Used in 27 crates (17 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