From 3ae76c1a16ea748f8f53df9f948e66a4fd694969 Mon Sep 17 00:00:00 2001 From: Harrison Burt Date: Fri, 31 Dec 2021 19:01:55 +0000 Subject: [PATCH] fix compile errors --- Cargo.toml | 2 +- src/cache.rs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9b78d23..8059ed8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lust" -version = "1.3.3" +version = "1.3.4" authors = ["Harrison Burt <57491488+ChillFish8@users.noreply.github.com>"] edition = "2018" documentation = "getting-started.md" diff --git a/src/cache.rs b/src/cache.rs index 7723aa3..82547df 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use bytes::BytesMut; -use concread::arcache::ARCache; +use concread::arcache::{ARCache, ARCacheBuilder}; use once_cell::sync::OnceCell; use uuid::Uuid; @@ -26,7 +26,11 @@ impl CacheState { let inst = if cache_size == 0 { Self { 0: None } } else { - let store = Arc::new(ARCache::new_size(cache_size, 12)); + let store = Arc::new(ARCacheBuilder::new() + .set_size(cache_size, 12) + .build() + .unwrap() + ); Self { 0: Some(store) } }; @@ -37,7 +41,7 @@ impl CacheState { pub fn get(&self, file_id: Uuid, preset: String, format: ImageFormat) -> Option { let state = self.0.as_ref()?; let ref_val = (file_id, preset, format); - let target = state.read(); + let mut target = state.read(); target.get(&ref_val).map(|v| v.clone()) }