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
14
15
16
use crate::StableMap;

#[test]
fn test() {
    let mut map1 = StableMap::new();
    map1.insert(1, 11);
    map1.insert(2, 22);
    let mut map2 = StableMap::new();
    map2.insert(1, 11);
    map2.insert(2, 22);
    assert_eq!(map1, map2);
    map2.remove(&2);
    assert_ne!(map1, map2);
    map2.insert(2, 22);
    assert_eq!(map1, map2);
}