#hash-map #stack #map

smolmap

A hashmap on the stack

1 unstable release

0.1.0-alpha.0 Jun 16, 2023

#2612 in Algorithms

AGPL-3.0

15KB
165 lines

smolmap

A hashmap on the stack in Rust, for fun, not really a serious project for now.

let mut map: SmolMap<u32, u32, 4> = SmolMap::new(RandomState::new());
map.insert(1, 3);
map.insert(2, 2);
map.insert(3, 1);
assert_eq!(map.get(&1), Some(&3));
assert_eq!(map.get(&2), Some(&2));
assert_eq!(map.get(&3), Some(&1));
assert_eq!(map.get(&6), None);

No runtime deps