Skip to content

Commit

Permalink
fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Harrison Burt committed Dec 31, 2021
1 parent 53f86af commit 3ae76c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lust"
version = "1.3.3"
version = "1.3.4"
authors = ["Harrison Burt <[email protected]>"]
edition = "2018"
documentation = "getting-started.md"
Expand Down
10 changes: 7 additions & 3 deletions src/cache.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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) }
};

Expand All @@ -37,7 +41,7 @@ impl CacheState {
pub fn get(&self, file_id: Uuid, preset: String, format: ImageFormat) -> Option<BytesMut> {
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())
}

Expand Down

0 comments on commit 3ae76c1

Please sign in to comment.