#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

#429 in Data structures

Download history 2067/week @ 2024-10-09 2409/week @ 2024-10-16 1873/week @ 2024-10-23 1916/week @ 2024-10-30 1891/week @ 2024-11-06 2235/week @ 2024-11-13 2116/week @ 2024-11-20 2311/week @ 2024-11-27 2051/week @ 2024-12-04 1675/week @ 2024-12-11 1328/week @ 2024-12-18 1355/week @ 2024-12-25 1269/week @ 2025-01-01 2139/week @ 2025-01-08 2495/week @ 2025-01-15 2702/week @ 2025-01-22

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