Skip to content

Commit 35237ac

Browse files
try/test reverting, will it compile?
1 parent c3e8f61 commit 35237ac

File tree

1 file changed

+10
-0
lines changed
  • sqlx-core/src/net/socket

1 file changed

+10
-0
lines changed

sqlx-core/src/net/socket/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,16 @@ pub async fn connect_tcp<Ws: WithSocket>(
196196
// IPv6 addresses in URLs will be wrapped in brackets and the `url` crate doesn't trim those.
197197
let host = host.trim_matches(&['[', ']'][..]);
198198

199+
#[cfg(feature = "_rt-tokio")]
200+
if crate::rt::rt_tokio::available() {
201+
use tokio::net::TcpStream;
202+
203+
let stream = TcpStream::connect((host, port)).await?;
204+
stream.set_nodelay(true)?;
205+
206+
return Ok(with_socket.with_socket(stream).await);
207+
}
208+
199209
let addresses = if let Ok(addr) = host.parse::<Ipv4Addr>() {
200210
let addr = SocketAddrV4::new(addr, port);
201211
vec![SocketAddr::V4(addr)].into_iter()

0 commit comments

Comments
 (0)