Skip to content

Declarative macros for statically initializing collections with ease

License

Notifications You must be signed in to change notification settings

jofas/map_macro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f908931 Β· Jan 29, 2024
Jan 28, 2024
Apr 13, 2023
Jan 29, 2024
Jan 28, 2024
May 11, 2021
Jan 29, 2024
Jan 29, 2024
May 11, 2021
Jan 29, 2024

Repository files navigation

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",
    "🌍" => "πŸ‘‹",
};