Apply suggestions from the review

Former-commit-id: 8489464bd3
This commit is contained in:
Maybe Waffle 2022-06-27 00:01:31 +04:00
parent 0b307aa177
commit 98a892e6bd

View file

@ -288,7 +288,7 @@ where
tokio::pin!(stream); tokio::pin!(stream);
loop { loop {
self.gc_workers_if_needed().await; self.remove_inactive_workers_if_needed().await;
// False positive // False positive
#[allow(clippy::collapsible_match)] #[allow(clippy::collapsible_match)]
@ -379,7 +379,7 @@ where
} }
} }
async fn gc_workers_if_needed(&mut self) { async fn remove_inactive_workers_if_needed(&mut self) {
let workers = self.workers.len(); let workers = self.workers.len();
let max = self.max_number_of_active_workers.load(Ordering::Relaxed) as usize; let max = self.max_number_of_active_workers.load(Ordering::Relaxed) as usize;
@ -387,11 +387,11 @@ where
return; return;
} }
self.gc_workers().await; self.remove_inactive_workers().await;
} }
#[inline(never)] #[inline(never)] // Cold function.
async fn gc_workers(&mut self) { async fn remove_inactive_workers(&mut self) {
let handles = self let handles = self
.workers .workers
.iter() .iter()