File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -416,13 +416,11 @@ impl Client {
416416
417417 /// Validates connection, timing out after specified duration.
418418 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+ } )
426424 }
427425
428426 /// Executes a sequence of SQL statements using the simple query protocol.
You can’t perform that action at this time.
0 commit comments