INNER CODE UNIT · Rust
remove_does_not_affect_other_items
lunatic-solutions/lunatic · crates/hash-map-id/src/lib.rs:164
fn remove_does_not_affect_other_items() {
let mut hash: HashMapId<i32> = HashMapId::new();
let value1 = 10;
let value2 = 20;
let value3 = 30;
let id1 = hash.add(value1);
let id2 = hash.add(value2);
let id3 = hash.add(value3);
hash.remove(id2);
assert_eq!(hash.get(id1), Some(&value1));
assert!(hash.get(id2).is_none());
assert_eq!(hash.get(id3), Some(&value3));
}