# compact-map [![Crates.io][crates-badge]][crates-url] [![Documentation][docs-badge]][docs-url] [![Latest Docs][docs-badge-latest]][latest-docs-url] ![MIT licensed][license-badge] [crates-badge]: https://img.shields.io/crates/v/compact-map.svg [crates-url]: https://crates.io/crates/compact-map [docs-badge]: https://docs.rs/compact-map/badge.svg [docs-url]: https://docs.rs/compact-map [docs-badge-latest]: https://img.shields.io/badge/docs-latest-blue [latest-docs-url]: https://lightsing.github.io/compact-map/compact_map/ [license-badge]: https://img.shields.io/badge/license-MIT%20OR%20Apache2.0-blue.svg 'Small map' optimization: store up to a small number of key-value pairs on the stack. Provides '1:1' API compatibility with `std::collections::HashMap`. ## Example ```rust use compact_map::CompactMap; fn main() { let mut map = CompactMap::default(); // default capacity is 16 // or you can specify the capacity // let mut map: CompactMap<&str, i32, 32> = CompactMap::default(); map.insert("a", 1); map.insert("b", 2); } ```