#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

#309 in Data structures

Download history 909/week @ 2024-07-28 903/week @ 2024-08-04 805/week @ 2024-08-11 808/week @ 2024-08-18 932/week @ 2024-08-25 1578/week @ 2024-09-01 1493/week @ 2024-09-08 1567/week @ 2024-09-15 1979/week @ 2024-09-22 2070/week @ 2024-09-29 2067/week @ 2024-10-06 2368/week @ 2024-10-13 2110/week @ 2024-10-20 1818/week @ 2024-10-27 1735/week @ 2024-11-03 2181/week @ 2024-11-10

7,968 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