From 1e7639bfc4dbf049c38e77aa3f6d0543df8a2132 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 8 Jun 2021 10:13:46 +0200 Subject: [PATCH] fixup minimum lru capacity Signed-off-by: Wolfgang Bumiller --- src/tools/lru_cache.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/lru_cache.rs b/src/tools/lru_cache.rs index 7c8cf25f..fc1c1850 100644 --- a/src/tools/lru_cache.rs +++ b/src/tools/lru_cache.rs @@ -106,7 +106,7 @@ unsafe impl Send for LruCache {} impl LruCache { /// Create LRU cache instance which holds up to `capacity` nodes at once. pub fn new(capacity: usize) -> Self { - let capacity = capacity.min(1); + let capacity = capacity.max(1); Self { map: HashMap::with_capacity(capacity), list: LinkedList::new(),