(&self)
| 274 | } |
| 275 | |
| 276 | fn evict(&self) { |
| 277 | if self.map.len() > self.capacity { |
| 278 | match &self.evict_strategy { |
| 279 | EvictStrategy::Immediate => self.evict_lru(), |
| 280 | EvictStrategy::Probabilistic(prob) => { |
| 281 | if self.map.len() > self.capacity && prob.should_trigger() { |
| 282 | self.evict_lru_probabilistic(prob); |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | fn evict_lru(&self) { |
| 290 | let mut oldest_pair = None; |
no test coverage detected