Skip to content

Commit

Permalink
Fix a Clippy warning (clippy 0.1.53, rustc 1.53.0-beta.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuya6502 committed May 8, 2021
1 parent a4ea5fe commit 2c93e3b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/sync/base_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,9 @@ where
// The entry has been already admitted, so treat this as an update.
deqs.move_to_back_ao(&entry);
deqs.move_to_back_wo(&entry);
done = true;
break;
} else if self.cache.len() <= self.max_capacity {
// There are some room in the cache. Add the candidate to the deques.
self.handle_admit(kh.clone(), &entry, last_accessed, last_modified, deqs);
done = true;
break;
} else {
let victim = match Self::find_cache_victim(deqs, freq) {
// Found a victim.
Expand Down Expand Up @@ -620,9 +616,9 @@ where
// The candidate is not admitted. Remove it from the cache (hash map).
self.cache.remove(&Arc::clone(&kh.key));
}
done = true;
break;
}
done = true;
break;
}

if !done {
Expand Down

0 comments on commit 2c93e3b

Please sign in to comment.