@@ -9,7 +9,6 @@ use std::task::Poll;
99use std:: time:: Duration ;
1010use std:: { error, fmt} ;
1111
12- use async_trait:: async_trait;
1312use futures_util:: future:: { err, lazy, ok, pending, ready, try_join_all, FutureExt } ;
1413use futures_util:: stream:: { FuturesUnordered , TryStreamExt } ;
1514use tokio:: sync:: oneshot;
@@ -43,7 +42,6 @@ impl<C> OkManager<C> {
4342 }
4443}
4544
46- #[ async_trait]
4745impl < C > ManageConnection for OkManager < C >
4846where
4947 C : Default + Send + Sync + ' static ,
@@ -78,7 +76,6 @@ impl<C> NthConnectionFailManager<C> {
7876 }
7977}
8078
81- #[ async_trait]
8279impl < C > ManageConnection for NthConnectionFailManager < C >
8380where
8481 C : Default + Send + Sync + ' static ,
@@ -214,7 +211,6 @@ struct BrokenConnectionManager<C> {
214211 _c : PhantomData < C > ,
215212}
216213
217- #[ async_trait]
218214impl < C : Default + Send + Sync + ' static > ManageConnection for BrokenConnectionManager < C > {
219215 type Connection = C ;
220216 type Error = Error ;
@@ -380,7 +376,6 @@ async fn test_now_invalid() {
380376
381377 struct Handler ;
382378
383- #[ async_trait]
384379 impl ManageConnection for Handler {
385380 type Connection = FakeConnection ;
386381 type Error = Error ;
@@ -689,7 +684,6 @@ async fn test_conns_drop_on_pool_drop() {
689684
690685 struct Handler ;
691686
692- #[ async_trait]
693687 impl ManageConnection for Handler {
694688 type Connection = Connection ;
695689 type Error = Error ;
@@ -741,7 +735,6 @@ async fn test_retry() {
741735 struct Connection ;
742736 struct Handler ;
743737
744- #[ async_trait]
745738 impl ManageConnection for Handler {
746739 type Connection = Connection ;
747740 type Error = Error ;
@@ -787,7 +780,6 @@ async fn test_conn_fail_once() {
787780 }
788781 }
789782
790- #[ async_trait]
791783 impl ManageConnection for Handler {
792784 type Connection = Connection ;
793785 type Error = Error ;
@@ -912,11 +904,15 @@ async fn test_customize_connection_acquire() {
912904 count : AtomicUsize ,
913905 }
914906
915- #[ async_trait]
916907 impl < E : ' static > CustomizeConnection < Connection , E > for CountingCustomizer {
917- async fn on_acquire ( & self , connection : & mut Connection ) -> Result < ( ) , E > {
918- connection. custom_field = 1 + self . count . fetch_add ( 1 , Ordering :: SeqCst ) ;
919- Ok ( ( ) )
908+ fn on_acquire < ' a > (
909+ & ' a self ,
910+ connection : & ' a mut Connection ,
911+ ) -> Pin < Box < dyn Future < Output = Result < ( ) , E > > + Send + ' a > > {
912+ Box :: pin ( async move {
913+ connection. custom_field = 1 + self . count . fetch_add ( 1 , Ordering :: SeqCst ) ;
914+ Ok ( ( ) )
915+ } )
920916 }
921917 }
922918
@@ -952,7 +948,6 @@ async fn test_broken_connections_dont_starve_pool() {
952948 #[ derive( Debug ) ]
953949 struct Connection ;
954950
955- #[ async_trait:: async_trait]
956951 impl bb8:: ManageConnection for ConnectionManager {
957952 type Connection = Connection ;
958953 type Error = Infallible ;
0 commit comments