From 0be52e39fc22153ced4ba2784b939fbe996d7338 Mon Sep 17 00:00:00 2001 From: Dotan Nahum Date: Sun, 29 Oct 2023 11:27:30 +0200 Subject: [PATCH] fix lints, counter API --- src/middleware.rs | 4 ++-- src/stats.rs | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/middleware.rs b/src/middleware.rs index 751d45b..f3b7ce9 100644 --- a/src/middleware.rs +++ b/src/middleware.rs @@ -165,7 +165,7 @@ impl ServerMiddleware for RetryMiddleware { chain: ChainIter, job: &Job, worker: Arc, - mut redis: RedisPool, + redis: RedisPool, ) -> ServerResult { let max_retries = worker.max_retries(); @@ -199,7 +199,7 @@ impl ServerMiddleware for RetryMiddleware { "err" => &job.error_message, ); - UnitOfWork::from_job(job).reenqueue(&mut redis).await?; + UnitOfWork::from_job(job).reenqueue(&redis).await?; } Ok(()) diff --git a/src/stats.rs b/src/stats.rs index 0b8b889..4fef33b 100644 --- a/src/stats.rs +++ b/src/stats.rs @@ -22,14 +22,12 @@ impl Counter { self.count.load(Ordering::SeqCst) } - #[must_use] - pub fn decrby(&self, n: usize) -> usize { - self.count.fetch_sub(n, Ordering::SeqCst) + pub fn decrby(&self, n: usize) { + self.count.fetch_sub(n, Ordering::SeqCst); } - #[must_use] - pub fn incrby(&self, n: usize) -> usize { - self.count.fetch_add(n, Ordering::SeqCst) + pub fn incrby(&self, n: usize) { + self.count.fetch_add(n, Ordering::SeqCst); } }