Logging fixes.

I had these lying around in the other bug.
This commit is contained in:
Bobby Holley 2017-04-11 18:42:36 +08:00
parent d50946933d
commit cceaf7c619
2 changed files with 17 additions and 0 deletions

View file

@ -31,6 +31,11 @@ impl<K: PartialEq> LRUCache<K> {
}
}
/// Returns the number of elements in the cache.
pub fn num_entries(&self) -> usize {
self.entries.len()
}
#[inline]
/// Touch a given position, and put it in the last item on the list.
pub fn touch(&mut self, pos: usize) {