File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -416,13 +416,11 @@ impl Client {
416
416
417
417
/// Validates connection, timing out after specified duration.
418
418
pub fn is_valid ( & mut self , timeout : Duration ) -> Result < ( ) , Error > {
419
- let is_valid = Client :: is_valid_inner ( & self . client , timeout) ;
420
- self . connection . block_on ( is_valid)
421
- }
422
-
423
- async fn is_valid_inner ( client : & tokio_postgres:: Client , timeout : Duration ) -> Result < ( ) , Error > {
424
- let trivial_query = client. simple_query ( "" ) ;
425
- tokio:: time:: timeout ( timeout, trivial_query) . await ?. map ( |_| ( ) )
419
+ let inner_client = & self . client ;
420
+ self . connection . block_on ( async {
421
+ let trivial_query = inner_client. simple_query ( "" ) ;
422
+ tokio:: time:: timeout ( timeout, trivial_query) . await ?. map ( |_| ( ) )
423
+ } )
426
424
}
427
425
428
426
/// Executes a sequence of SQL statements using the simple query protocol.
You can’t perform that action at this time.
0 commit comments