@@ -158,13 +158,13 @@ impl Write for HttpStream {
158158 }
159159}
160160
161- #[ cfg( feature = "tokio- rustls" ) ]
161+ #[ cfg( any ( feature = "async-https- rustls" , feature = "async-https-rustls-probe" ) ) ]
162162type AsyncSecuredStream = rustls_stream:: AsyncSecuredStream ;
163163
164164#[ cfg( feature = "async" ) ]
165165pub ( crate ) enum AsyncHttpStream {
166166 Unsecured ( AsyncTcpStream ) ,
167- #[ cfg( feature = "tokio- rustls" ) ]
167+ #[ cfg( any ( feature = "async-https- rustls" , feature = "async-https-rustls-probe" ) ) ]
168168 Secured ( Box < AsyncSecuredStream > ) ,
169169}
170170
@@ -177,7 +177,7 @@ impl AsyncRead for AsyncHttpStream {
177177 ) -> Poll < io:: Result < ( ) > > {
178178 match & mut * self {
179179 AsyncHttpStream :: Unsecured ( inner) => Pin :: new ( inner) . poll_read ( cx, buf) ,
180- #[ cfg( feature = "tokio- rustls" ) ]
180+ #[ cfg( any ( feature = "async-https- rustls" , feature = "async-https-rustls-probe" ) ) ]
181181 AsyncHttpStream :: Secured ( inner) => Pin :: new ( inner) . poll_read ( cx, buf) ,
182182 }
183183 }
@@ -192,23 +192,23 @@ impl AsyncWrite for AsyncHttpStream {
192192 ) -> Poll < io:: Result < usize > > {
193193 match & mut * self {
194194 AsyncHttpStream :: Unsecured ( inner) => Pin :: new ( inner) . poll_write ( cx, buf) ,
195- #[ cfg( feature = "tokio- rustls" ) ]
195+ #[ cfg( any ( feature = "async-https- rustls" , feature = "async-https-rustls-probe" ) ) ]
196196 AsyncHttpStream :: Secured ( inner) => Pin :: new ( inner) . poll_write ( cx, buf) ,
197197 }
198198 }
199199
200200 fn poll_flush ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < io:: Result < ( ) > > {
201201 match & mut * self {
202202 AsyncHttpStream :: Unsecured ( inner) => Pin :: new ( inner) . poll_flush ( cx) ,
203- #[ cfg( feature = "tokio- rustls" ) ]
203+ #[ cfg( any ( feature = "async-https- rustls" , feature = "async-https-rustls-probe" ) ) ]
204204 AsyncHttpStream :: Secured ( inner) => Pin :: new ( inner) . poll_flush ( cx) ,
205205 }
206206 }
207207
208208 fn poll_shutdown ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < io:: Result < ( ) > > {
209209 match & mut * self {
210210 AsyncHttpStream :: Unsecured ( inner) => Pin :: new ( inner) . poll_shutdown ( cx) ,
211- #[ cfg( feature = "tokio- rustls" ) ]
211+ #[ cfg( any ( feature = "async-https- rustls" , feature = "async-https-rustls-probe" ) ) ]
212212 AsyncHttpStream :: Secured ( inner) => Pin :: new ( inner) . poll_shutdown ( cx) ,
213213 }
214214 }
@@ -271,9 +271,12 @@ impl AsyncConnection {
271271 let socket = Self :: connect ( params) . await ?;
272272
273273 if params. https {
274- #[ cfg( not( feature = "tokio-rustls" ) ) ]
274+ #[ cfg( not( any(
275+ feature = "async-https-rustls" ,
276+ feature = "async-https-rustls-probe"
277+ ) ) ) ]
275278 return Err ( Error :: HttpsFeatureNotEnabled ) ;
276- #[ cfg( feature = "tokio- rustls" ) ]
279+ #[ cfg( any ( feature = "async-https- rustls" , feature = "async-https-rustls-probe" ) ) ]
277280 rustls_stream:: wrap_async_stream ( socket, params. host ) . await
278281 } else {
279282 Ok ( AsyncHttpStream :: Unsecured ( socket) )
0 commit comments