Skip to content

Commit

Permalink
~[] to Vec in util/cache.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
murphm8 authored and Ms2ger committed May 4, 2014
1 parent 33d0a3a commit 631f70b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/util/cache.rs
Expand Up @@ -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,
}
}
Expand All @@ -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)> {
Expand Down

0 comments on commit 631f70b

Please sign in to comment.