Skip to content

Commit

Permalink
fix lints, counter API
Browse files Browse the repository at this point in the history
  • Loading branch information
jondot committed Oct 29, 2023
1 parent c1ce18d commit 0be52e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl ServerMiddleware for RetryMiddleware {
chain: ChainIter,
job: &Job,
worker: Arc<WorkerRef>,
mut redis: RedisPool,
redis: RedisPool,
) -> ServerResult {
let max_retries = worker.max_retries();

Expand Down Expand Up @@ -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(())
Expand Down
10 changes: 4 additions & 6 deletions src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 0be52e3

Please sign in to comment.