mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Remove HashCache.
This commit is contained in:
parent
24fe6bc4da
commit
fa05a309f3
2 changed files with 2 additions and 64 deletions
|
@ -3,20 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::cell::Cell;
|
||||
use util::cache::{HashCache, LRUCache};
|
||||
|
||||
#[test]
|
||||
fn test_hashcache() {
|
||||
let mut cache: HashCache<usize, Cell<&str>> = HashCache::new();
|
||||
|
||||
cache.insert(1, Cell::new("one"));
|
||||
assert!(cache.find(&1).is_some());
|
||||
assert!(cache.find(&2).is_none());
|
||||
|
||||
cache.find_or_create(2, || { Cell::new("two") });
|
||||
assert!(cache.find(&1).is_some());
|
||||
assert!(cache.find(&2).is_some());
|
||||
}
|
||||
use util::cache::LRUCache;
|
||||
|
||||
#[test]
|
||||
fn test_lru_cache() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue