From 56aa88fbbd98877a8960f29233b8747aabfb312a Mon Sep 17 00:00:00 2001 From: Yiyao Yu Date: Tue, 20 Apr 2021 21:18:45 -0400 Subject: [PATCH] Updated split_iterators to use Vec::with_capacity instead of Vec::new. --- src/threadpool.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/threadpool.rs b/src/threadpool.rs index 637fb6d..f5c8b8d 100644 --- a/src/threadpool.rs +++ b/src/threadpool.rs @@ -121,8 +121,7 @@ impl ThreadPoolManager { where T: Iterator, { - let mut split = Vec::new(); - split.reserve_exact(self.num_threads); + let mut split = Vec::with_capacity(self.num_threads); for _ in 0..self.num_threads { split.push(Vec::new()); }