Remove unnecessary unwrap in Pool::_get_conn
@@ -146,13 +146,11 @@ impl Pool {
let mut conn = if let Some(conn) = conn {
conn
} else {
- let out_conn;
let mut pool = inner_pool.lock()?;
loop {
if let Some(conn) = pool.pool.pop_front() {
drop(pool);
- out_conn = Some(conn);
- break;
+ break conn;
} else if self.count.load(Ordering::Relaxed) < self.max.load(Ordering::Relaxed) {
pool.new_conn()?;
self.count.fetch_add(1, Ordering::SeqCst);
@@ -167,7 +165,6 @@ impl Pool {
}
}
}
- out_conn.unwrap()
};
if call_ping && self.check_health && !conn.ping() {
