File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -234,18 +234,15 @@ pub async fn connect_tcp<Ws: WithSocket>(
234
234
}
235
235
236
236
async fn connect_tcp_address ( socket_addr : SocketAddr ) -> crate :: Result < impl Socket > {
237
- #[ cfg( feature = "_rt-tokio" ) ]
238
- if crate :: rt:: rt_tokio:: available ( ) {
239
- use tokio:: net:: TcpStream ;
240
-
241
- let stream = TcpStream :: connect ( socket_addr) . await ?;
242
- stream. set_nodelay ( true ) ?;
237
+ cfg_if ! {
238
+ if #[ cfg( feature = "_rt-tokio" ) ] {
239
+ use tokio:: net:: TcpStream ;
243
240
244
- return Ok ( stream) ;
245
- }
241
+ let stream = TcpStream :: connect ( socket_addr ) . await ? ;
242
+ stream . set_nodelay ( true ) ? ;
246
243
247
- cfg_if ! {
248
- if #[ cfg( feature = "_rt-async-io" ) ] {
244
+ Ok ( stream )
245
+ } else if #[ cfg( feature = "_rt-async-io" ) ] {
249
246
use async_io:: Async ;
250
247
use std:: net:: TcpStream ;
251
248
You can’t perform that action at this time.
0 commit comments