Skip to content
Permalink
Browse files

~[] to Vec in util/cache.rs

  • Loading branch information...
murphm8 authored and Ms2ger committed Apr 28, 2014
1 parent 33d0a3a commit 631f70b1c5821aea17df298a414017441561f763
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/components/util/cache.rs
@@ -120,14 +120,14 @@ fn test_hashcache() {
}

pub struct LRUCache<K, V> {
entries: ~[(K, V)],
entries: Vec<(K, V)>,
cache_size: uint,
}

impl<K: Clone + Eq, V: Clone> LRUCache<K,V> {
pub fn new(size: uint) -> LRUCache<K, V> {
LRUCache {
entries: ~[],
entries: Vec::new(),
cache_size: size,
}
}
@@ -139,7 +139,7 @@ impl<K: Clone + Eq, V: Clone> LRUCache<K,V> {
let entry = self.entries.remove(pos);
self.entries.push(entry.unwrap());
}
self.entries[last_index].ref1().clone()
self.entries.get(last_index).ref1().clone()
}

pub fn iter<'a>(&'a self) -> Items<'a,(K,V)> {

0 comments on commit 631f70b

Please sign in to comment.
You can’t perform that action at this time.