@@ -33,11 +33,11 @@ use futures_util::stream::{futures_unordered::FuturesUnordered, StreamExt};
3333///```
3434
3535#[ derive( Default ) ]
36- pub struct ConcurrentListener < State > {
37- listeners : Vec < Box < dyn Listener < State > > > ,
36+ pub struct ConcurrentListener {
37+ listeners : Vec < Box < dyn Listener > > ,
3838}
3939
40- impl < State : Clone + Send + Sync + ' static > ConcurrentListener < State > {
40+ impl ConcurrentListener {
4141 /// creates a new ConcurrentListener
4242 pub fn new ( ) -> Self {
4343 Self { listeners : vec ! [ ] }
@@ -59,7 +59,7 @@ impl<State: Clone + Send + Sync + 'static> ConcurrentListener<State> {
5959 /// ```
6060 pub fn add < L > ( & mut self , listener : L ) -> io:: Result < ( ) >
6161 where
62- L : ToListener < State > ,
62+ L : ToListener ,
6363 {
6464 self . listeners . push ( Box :: new ( listener. to_listener ( ) ?) ) ;
6565 Ok ( ( ) )
@@ -78,19 +78,16 @@ impl<State: Clone + Send + Sync + 'static> ConcurrentListener<State> {
7878 /// # Ok(()) }) }
7979 pub fn with_listener < L > ( mut self , listener : L ) -> Self
8080 where
81- L : ToListener < State > ,
81+ L : ToListener ,
8282 {
8383 self . add ( listener) . expect ( "Unable to add listener" ) ;
8484 self
8585 }
8686}
8787
8888#[ async_trait:: async_trait]
89- impl < State > Listener < State > for ConcurrentListener < State >
90- where
91- State : Clone + Send + Sync + ' static ,
92- {
93- async fn bind ( & mut self , app : Server < State > ) -> io:: Result < ( ) > {
89+ impl Listener for ConcurrentListener {
90+ async fn bind ( & mut self , app : Server ) -> io:: Result < ( ) > {
9491 for listener in self . listeners . iter_mut ( ) {
9592 listener. bind ( app. clone ( ) ) . await ?;
9693 }
@@ -118,13 +115,13 @@ where
118115 }
119116}
120117
121- impl < State > Debug for ConcurrentListener < State > {
118+ impl Debug for ConcurrentListener {
122119 fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
123120 write ! ( f, "{:?}" , self . listeners)
124121 }
125122}
126123
127- impl < State > Display for ConcurrentListener < State > {
124+ impl Display for ConcurrentListener {
128125 fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
129126 let string = self
130127 . listeners
0 commit comments