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 @@ -682,13 +682,12 @@ impl SqlxConnection {
682682 let con_str = format ! ( "{protocol_type}://{user}:{pass}@{host}:{port}{db}" ) ;
683683
684684 // see if we have a wrapper with the correct con_str
685- {
686- let map = & mut * POOLS . lock ( ) . expect ( "could not lock mutex" ) ;
685+
686+ let map = & mut * POOLS . lock ( ) . expect ( "could not lock mutex" ) ;
687687
688- if let Some ( con_ref) = map. get ( & con_str) {
689- if let Some ( con_arc) = con_ref. upgrade ( ) {
690- return Ok ( con_arc) ;
691- }
688+ if let Some ( con_ref) = map. get ( & con_str) {
689+ if let Some ( con_arc) = con_ref. upgrade ( ) {
690+ return Ok ( con_arc) ;
692691 }
693692 }
694693
@@ -743,7 +742,6 @@ impl SqlxConnection {
743742
744743 // register con in pools
745744 let arc = Arc :: new ( con) ;
746- let map = & mut * POOLS . lock ( ) . expect ( "could not lock mutex" ) ;
747745 map. insert ( con_str2, Arc :: downgrade ( & arc) ) ;
748746 // return arc
749747 Ok ( arc)
You can’t perform that action at this time.
0 commit comments