#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

#315 in Data structures

Download history 962/week @ 2024-08-02 717/week @ 2024-08-09 893/week @ 2024-08-16 858/week @ 2024-08-23 1351/week @ 2024-08-30 1683/week @ 2024-09-06 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 2391/week @ 2024-11-15

8,439 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