#hash-map #literals #macro #data-structures

maplit2

Collection helper libraries and “literal” macros for HashMap, HashSet, BTreeMap, and BTreeSet

4 stable releases

Uses old Rust 2015

1.0.5 May 24, 2023

#1197 in Rust patterns

Download history 84/week @ 2024-01-04 135/week @ 2024-01-11 124/week @ 2024-01-18 88/week @ 2024-01-25 76/week @ 2024-02-01 107/week @ 2024-02-08 41/week @ 2024-02-15 58/week @ 2024-02-22 42/week @ 2024-02-29 75/week @ 2024-03-07 85/week @ 2024-03-14 113/week @ 2024-03-21 335/week @ 2024-03-28 15/week @ 2024-04-04 16/week @ 2024-04-11 47/week @ 2024-04-18

476 downloads per month
Used in sos

MIT/Apache

17KB
263 lines

maplit2

Successor to maplit

Maplit has stopped being updated, so this is the new home for maplit improvements.

Maplit

Container / collection literal macros for HashMap, HashSet, BTreeMap, BTreeSet.

You can use these for convenience. Using them has no other implications.

Please read the API documentation here

build_status

FAQ

Question: Very large maps take a long time to compile?

Answer: Rustc is very slow to compile big expressions with many literals (including integers and float literals). Work around this by either using explicitly typed literals, or explicitly typed conversions. See https://github.com/bluss/maplit/issues/14 for more information.

License

Dual-licensed to be compatible with the Rust project.

Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 or the MIT license http://opensource.org/licenses/MIT, at your option. This file may not be copied, modified, or distributed except according to those terms.

No runtime deps