diff --git a/Cargo.toml b/Cargo.toml index bcc8c7b..f06f3c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ kamadak-exif = "0.5.0" libc = "0.2.68" log = "0.4.8" mime = "0.3.0" -r2d2-memcache = "0.5.0" +r2d2-memcache = "0.6" rand = "0.7.0" regex = "1.3.6" reqwest = { version = "0.10.4", features = ["json"] } diff --git a/src/adm/precache.rs b/src/adm/precache.rs index 6d14e5c..8646d38 100644 --- a/src/adm/precache.rs +++ b/src/adm/precache.rs @@ -34,7 +34,7 @@ impl Args { pub async fn run(&self) -> Result<(), Error> { let max_time = Duration::from_secs(self.max_time); let timer = Instant::now(); - let mut cache = Client::connect(self.cache.memcached_url.as_ref())?; + let cache = Client::connect(self.cache.memcached_url.as_ref())?; let size = SizeTag::Small; let (mut n, mut n_stored) = (0, 0); let photos = Photo::query(true) diff --git a/src/server/context.rs b/src/server/context.rs index 5fde9a8..1e67092 100644 --- a/src/server/context.rs +++ b/src/server/context.rs @@ -145,7 +145,7 @@ impl Context { R: Future, E>>, { match self.global.cache() { - Ok(mut client) => { + Ok(client) => { match client.get(key) { Ok(Some(data)) => { debug!("Cache: {} found", key); @@ -172,7 +172,7 @@ impl Context { } } pub fn clear_cache(&self, key: &str) { - if let Ok(mut client) = self.global.cache() { + if let Ok(client) = self.global.cache() { match client.delete(key) { Ok(flag) => debug!("Cache: deleted {}: {:?}", key, flag), Err(e) => warn!("Cache: Failed to delete {}: {}", key, e),