The following example often panics proving that HashCache may evict entries even when capacity is not yet fully occupated.
const CAPACITY: usize = 64;
let hc = scc::HashCache::with_capacity(CAPACITY, CAPACITY);
for i in 0..CAPACITY {
let k = format!("key{i}");
match hc.put(k, i).unwrap() {
None => (),
Some((k, _)) => panic!("Evicted {k}"),
}
}
Is this a bug or normal behavior?
If it's normal, I think it should be documented.
The following example often panics proving that HashCache may evict entries even when capacity is not yet fully occupated.
Is this a bug or normal behavior? If it's normal, I think it should be documented.