File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -160,19 +160,21 @@ impl Context {
160160 ) {
161161 let context = self ;
162162
163- let context2 = context. clone ( ) ;
164- let conn_fut = async move {
165- let conn = context2
166- . endpoint
167- . connect ( node_id, & context2. alpn )
168- . await
169- . map_err ( PoolConnectError :: from) ?;
170- if let Some ( on_connect) = & context2. options . on_connected {
171- on_connect ( & context2. endpoint , & conn)
163+ let conn_fut = {
164+ let context = context. clone ( ) ;
165+ async move {
166+ let conn = context
167+ . endpoint
168+ . connect ( node_id, & context. alpn )
172169 . await
173170 . map_err ( PoolConnectError :: from) ?;
171+ if let Some ( on_connect) = & context. options . on_connected {
172+ on_connect ( & context. endpoint , & conn)
173+ . await
174+ . map_err ( PoolConnectError :: from) ?;
175+ }
176+ Result :: < Connection , PoolConnectError > :: Ok ( conn)
174177 }
175- Result :: < Connection , PoolConnectError > :: Ok ( conn)
176178 } ;
177179
178180 // Connect to the node
You can’t perform that action at this time.
0 commit comments