@@ -241,20 +241,17 @@ impl ConnectionPool {
241
241
let old_pool_ref = get_pool ( pool_name, & user. username ) ;
242
242
let identifier = PoolIdentifier :: new ( pool_name, & user. username ) ;
243
243
244
- match old_pool_ref {
245
- Some ( pool) => {
246
- // If the pool hasn't changed, get existing reference and insert it into the new_pools.
247
- // We replace all pools at the end, but if the reference is kept, the pool won't get re-created (bb8).
248
- if pool. config_hash == new_pool_hash_value {
249
- info ! (
250
- "[pool: {}][user: {}] has not changed" ,
251
- pool_name, user. username
252
- ) ;
253
- new_pools. insert ( identifier. clone ( ) , pool. clone ( ) ) ;
254
- continue ;
255
- }
244
+ if let Some ( pool) = old_pool_ref {
245
+ // If the pool hasn't changed, get existing reference and insert it into the new_pools.
246
+ // We replace all pools at the end, but if the reference is kept, the pool won't get re-created (bb8).
247
+ if pool. config_hash == new_pool_hash_value {
248
+ info ! (
249
+ "[pool: {}][user: {}] has not changed" ,
250
+ pool_name, user. username
251
+ ) ;
252
+ new_pools. insert ( identifier. clone ( ) , pool. clone ( ) ) ;
253
+ continue ;
256
254
}
257
- None => ( ) ,
258
255
}
259
256
260
257
info ! (
@@ -399,7 +396,7 @@ impl ConnectionPool {
399
396
} ,
400
397
} ;
401
398
402
- let reaper_rate = * vec ! [ idle_timeout, server_lifetime, POOL_REAPER_RATE ]
399
+ let reaper_rate = * [ idle_timeout, server_lifetime, POOL_REAPER_RATE ]
403
400
. iter ( )
404
401
. min ( )
405
402
. unwrap ( ) ;
@@ -489,7 +486,7 @@ impl ConnectionPool {
489
486
. clone ( )
490
487
. map ( |regex| Regex :: new ( regex. as_str ( ) ) . unwrap ( ) ) ,
491
488
regex_search_limit : pool_config. regex_search_limit . unwrap_or ( 1000 ) ,
492
- default_shard : pool_config. default_shard . clone ( ) ,
489
+ default_shard : pool_config. default_shard ,
493
490
auth_query : pool_config. auth_query . clone ( ) ,
494
491
auth_query_user : pool_config. auth_query_user . clone ( ) ,
495
492
auth_query_password : pool_config. auth_query_password . clone ( ) ,
@@ -678,7 +675,7 @@ impl ConnectionPool {
678
675
let mut force_healthcheck = false ;
679
676
680
677
if self . is_banned ( address) {
681
- if self . try_unban ( & address) . await {
678
+ if self . try_unban ( address) . await {
682
679
force_healthcheck = true ;
683
680
} else {
684
681
debug ! ( "Address {:?} is banned" , address) ;
@@ -806,8 +803,8 @@ impl ConnectionPool {
806
803
// Don't leave a bad connection in the pool.
807
804
server. mark_bad ( ) ;
808
805
809
- self . ban ( & address, BanReason :: FailedHealthCheck , Some ( client_info) ) ;
810
- return false ;
806
+ self . ban ( address, BanReason :: FailedHealthCheck , Some ( client_info) ) ;
807
+ false
811
808
}
812
809
813
810
/// Ban an address (i.e. replica). It no longer will serve
@@ -931,10 +928,10 @@ impl ConnectionPool {
931
928
let guard = self . banlist . read ( ) ;
932
929
for banlist in guard. iter ( ) {
933
930
for ( address, ( reason, timestamp) ) in banlist. iter ( ) {
934
- bans. push ( ( address. clone ( ) , ( reason. clone ( ) , timestamp. clone ( ) ) ) ) ;
931
+ bans. push ( ( address. clone ( ) , ( reason. clone ( ) , * timestamp) ) ) ;
935
932
}
936
933
}
937
- return bans;
934
+ bans
938
935
}
939
936
940
937
/// Get the address from the host url
@@ -992,7 +989,7 @@ impl ConnectionPool {
992
989
}
993
990
let busy = provisioned - idle;
994
991
debug ! ( "{:?} has {:?} busy connections" , address, busy) ;
995
- return busy;
992
+ busy
996
993
}
997
994
998
995
fn valid_shard_id ( & self , shard : Option < usize > ) -> bool {
@@ -1031,6 +1028,7 @@ pub struct ServerPool {
1031
1028
}
1032
1029
1033
1030
impl ServerPool {
1031
+ #[ allow( clippy:: too_many_arguments) ]
1034
1032
pub fn new (
1035
1033
address : Address ,
1036
1034
user : User ,
0 commit comments