124124
125125// re-exports
126126// sync
127- cfg_sync_pool ! {
127+ cfg_sync ! {
128128 /// [`r2d2`](https://docs.rs/r2d2)'s error type
129129 pub use r2d2:: Error as r2d2Error;
130130 pub use self :: sync_impls:: Pool ;
@@ -134,20 +134,21 @@ cfg_sync_pool! {
134134 . max_size( max_size)
135135 . build( ConnectionManager :: new_notls( host. to_string( ) , port) )
136136 }
137- cfg_sync_ssl_any! {
138- pub use self :: sync_impls :: TlsPool ;
139- /// Returns a TLS pool of the specified size and provided settings
140- pub fn get_tls ( host : impl ToString , port : u16 , cert : impl ToString , max_size : u32 ) -> Result < TlsPool , r2d2Error> {
141- TlsPool :: builder ( )
142- . max_size ( max_size )
143- . build (
144- ConnectionManager :: new_tls ( host . to_string ( ) , port , cert )
145- )
146- }
137+ }
138+ cfg_sync_ssl_any ! {
139+ pub use self :: sync_impls :: TlsPool ;
140+ /// Returns a TLS pool of the specified size and provided settings
141+ pub fn get_tls ( host : impl ToString , port : u16 , cert : impl ToString , max_size : u32 ) -> Result < TlsPool , r2d2Error> {
142+ TlsPool :: builder ( )
143+ . max_size ( max_size )
144+ . build (
145+ ConnectionManager :: new_tls ( host . to_string ( ) , port , cert )
146+ )
147147 }
148148}
149+
149150// async
150- cfg_async_pool ! {
151+ cfg_async ! {
151152 /// [`bb8`](https://docs.rs/bb8)'s error type
152153 pub use bb8:: RunError as bb8Error;
153154 pub use self :: async_impls:: Pool as AsyncPool ;
@@ -158,14 +159,14 @@ cfg_async_pool! {
158159 . max_size( max_size)
159160 . build( ConnectionManager :: new_notls( host. to_string( ) , port) ) . await
160161 }
161- cfg_async_ssl_any! {
162- pub use self :: async_impls :: TlsPool as AsyncTlsPool ;
163- /// Returns an async TLS pool of the specified size and provided settings
164- pub async fn get_tls_async ( host : impl ToString , port : u16 , cert : impl ToString , max_size : u32 ) -> Result < AsyncTlsPool , Error > {
165- AsyncTlsPool :: builder ( )
166- . max_size ( max_size )
167- . build ( ConnectionManager :: new_tls ( host . to_string ( ) , port , cert ) ) . await
168- }
162+ }
163+ cfg_async_ssl_any ! {
164+ pub use self :: async_impls :: TlsPool as AsyncTlsPool ;
165+ /// Returns an async TLS pool of the specified size and provided settings
166+ pub async fn get_tls_async ( host : impl ToString , port : u16 , cert : impl ToString , max_size : u32 ) -> Result < AsyncTlsPool , Error > {
167+ AsyncTlsPool :: builder ( )
168+ . max_size ( max_size )
169+ . build ( ConnectionManager :: new_tls ( host . to_string ( ) , port , cert ) ) . await
169170 }
170171}
171172
@@ -203,7 +204,8 @@ impl<C> ConnectionManager<C> {
203204 }
204205}
205206
206- #[ cfg( any( feature = "sync" , feature = "pool" ) ) ]
207+ #[ cfg( feature = "sync" ) ]
208+ #[ cfg_attr( docsrs, doc( cfg( feature = "sync" ) ) ) ]
207209mod sync_impls {
208210 use super :: ConnectionManager ;
209211 use crate :: sync:: Connection as SyncConnection ;
@@ -274,7 +276,8 @@ mod sync_impls {
274276 }
275277}
276278
277- #[ cfg( any( feature = "aio" , feature = "aio-pool" ) ) ]
279+ #[ cfg( feature = "aio" ) ]
280+ #[ cfg_attr( docsrs, doc( cfg( feature = "aio" ) ) ) ]
278281mod async_impls {
279282 use super :: ConnectionManager ;
280283 use crate :: aio:: Connection as AsyncConnection ;
0 commit comments