Crates.io | smolmap |
lib.rs | smolmap |
version | 0.1.0-alpha.0 |
source | src |
created_at | 2023-06-16 18:38:56.331591 |
updated_at | 2023-06-16 18:38:56.331591 |
description | A hashmap on the stack. |
homepage | |
repository | https://github.com/edg-l/smolmap |
max_upload_size | |
id | 892510 |
size | 42,335 |
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);