Skip to content

Commit

Permalink
Fix Clippy warnings
Browse files Browse the repository at this point in the history
clippy 0.1.54 (bf62f4de32a 2021-06-23)
  • Loading branch information
tatsuya6502 committed Jun 25, 2021
1 parent 56ba3f0 commit 17b6aa0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/common/thread_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl ThreadPoolRegistry {
}

pub(crate) fn release_pool(pool: &Arc<ThreadPool>) {
if Arc::strong_count(&pool) <= 2 {
if Arc::strong_count(pool) <= 2 {
// No other client exists; only this Arc and the registry are
// the owners. Let's remove and drop the one in the registry.
let name = pool.name;
Expand Down
6 changes: 3 additions & 3 deletions src/sync/base_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl<K, V, S> Clone for BaseCache<K, V, S> {
inner: Arc::clone(&self.inner),
read_op_ch: self.read_op_ch.clone(),
write_op_ch: self.write_op_ch.clone(),
housekeeper: self.housekeeper.as_ref().map(|h| Arc::clone(&h)),
housekeeper: self.housekeeper.as_ref().map(|h| Arc::clone(h)),
}
}
}
Expand Down Expand Up @@ -264,7 +264,7 @@ where
let cnt = op_cnt2.fetch_add(1, Ordering::Relaxed);
op2 = Some((
cnt,
Arc::clone(&old_entry),
Arc::clone(old_entry),
WriteOp::Upsert(KeyHash::new(Arc::clone(&key), hash), Arc::clone(&entry)),
));
entry
Expand Down Expand Up @@ -756,7 +756,7 @@ where
entry,
);
if self.is_write_order_queue_enabled() {
deqs.push_back_wo(KeyDate::new(key, raw_last_modified), &entry);
deqs.push_back_wo(KeyDate::new(key, raw_last_modified), entry);
}
entry.set_is_admitted(true);
}
Expand Down
6 changes: 3 additions & 3 deletions src/unsync/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ where
let keys_to_invalidate = cache
.iter()
.filter(|(key, entry)| (predicate)(key, &entry.value))
.map(|(key, _)| Rc::clone(&key))
.map(|(key, _)| Rc::clone(key))
.collect::<Vec<_>>();

keys_to_invalidate.into_iter().for_each(|k| {
Expand Down Expand Up @@ -462,8 +462,8 @@ where
entry.set_last_modified(ts);
}
let deqs = &mut self.deques;
deqs.move_to_back_ao(&entry);
deqs.move_to_back_wo(&entry)
deqs.move_to_back_ao(entry);
deqs.move_to_back_wo(entry)
}

fn evict(&mut self, now: Instant) {
Expand Down

0 comments on commit 17b6aa0

Please sign in to comment.