stable-map 0.15.0

A hash map with temporarily stable indices
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::StableMap;

#[test]
fn test() {
    let mut map = StableMap::new();
    map.insert(1, 11);
    map.insert(2, 22);
    map.extend([(1, 33), (4, 44)]);
    assert_eq!(map.len(), 3);
    assert_eq!(map[&1], 33);
    assert_eq!(map[&2], 22);
    assert_eq!(map[&4], 44);
}