From b01be808c53cd5581a31be7d0502a9d71377edfe Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Fri, 25 Sep 2020 00:10:35 -0700 Subject: [PATCH] Fix set_max_idle_connections(0). This broke during some recent refactorings. The special case branch for max_connections == 0 wasn't actually setting the max_idle_connections field. This change simply deletes that branch, since the existing code that whittles down the pool size one element at a time suffices. In the common case this will be set on an empty pool anyhow. --- src/pool.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/pool.rs b/src/pool.rs index 5c3482f..8d66d40 100644 --- a/src/pool.rs +++ b/src/pool.rs @@ -79,13 +79,6 @@ impl ConnectionPool { return; } - if max_connections == 0 { - // Clear the connection pool, caching is disabled. - self.lru.clear(); - self.recycle.clear(); - return; - } - // Remove any extra connections if the number was decreased. while self.lru.len() > max_connections { self.remove_oldest();