Skip to content

Commit f8fe6ca

Browse files
committed
fix: platform-specific return type for async-std in tls_prelogin_stream_wrapper
- Return 0 for async-std and () for tokio in poll_read - Fixes compilation with runtime-async-std-rustls feature
1 parent 95d02e1 commit f8fe6ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sqlx-core/src/mssql/connection/tls_prelogin_stream_wrapper.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ impl<S: AsyncRead + AsyncWrite + Unpin + Send> AsyncRead for TlsPreloginWrapper<
100100

101101
let read = header_buf.filled().len();
102102
if read == 0 {
103+
#[cfg(feature = "_rt-async-std")]
104+
return Poll::Ready(Ok(0));
105+
#[cfg(feature = "_rt-tokio")]
103106
return Poll::Ready(Ok(()));
104107
}
105108

@@ -153,6 +156,9 @@ impl<S: AsyncRead + AsyncWrite + Unpin + Send> AsyncRead for TlsPreloginWrapper<
153156
let read = ready!(Pin::new(&mut inner.stream).poll_read(cx, header_buf))?;
154157

155158
if read == 0 {
159+
#[cfg(feature = "_rt-async-std")]
160+
return Poll::Ready(Ok(0));
161+
#[cfg(feature = "_rt-tokio")]
156162
return Poll::Ready(Ok(()));
157163
}
158164

0 commit comments

Comments
 (0)