@@ -138,14 +138,22 @@ pub(crate) async fn ipfs_command_handler(
138138 send_response ( result, tx) ;
139139 } ,
140140 IpfsCommand :: Subscribe ( topic, kind, tx) => {
141+ dbg ! ( ) ;
141142 let stream = hermes_node
142143 . pubsub_subscribe ( & topic)
143144 . await
144145 . map_err ( |_| Errno :: PubsubSubscribeError ) ?;
145- let message_handler = TopicMessageHandler :: new ( & topic, match kind {
146- SubscriptionKind :: Default => topic_message_handler,
147- SubscriptionKind :: DocSync => doc_sync_topic_message_handler,
148- } ) ;
146+ dbg ! ( ) ;
147+
148+ let message_handler = TopicMessageHandler :: new (
149+ & topic,
150+ match kind {
151+ SubscriptionKind :: Default => topic_message_handler,
152+ SubscriptionKind :: DocSync => doc_sync_topic_message_handler,
153+ } ,
154+ ) ;
155+ dbg ! ( ) ;
156+
149157 let subscription_handler =
150158 TopicSubscriptionStatusHandler :: new ( & topic, topic_subscription_handler) ;
151159 let handle = hermes_ipfs:: subscription_stream_task (
@@ -183,12 +191,10 @@ pub(crate) async fn ipfs_command_handler(
183191 } ,
184192 IpfsCommand :: Identity ( peer_id, tx) => {
185193 let peer_id = match peer_id {
186- Some ( peer_id) => {
187- Some (
188- hermes_ipfs:: PeerId :: from_str ( & peer_id)
189- . map_err ( |_| Errno :: InvalidPeerId ) ?,
190- )
191- } ,
194+ Some ( peer_id) => Some (
195+ hermes_ipfs:: PeerId :: from_str ( & peer_id)
196+ . map_err ( |_| Errno :: InvalidPeerId ) ?,
197+ ) ,
192198 None => None ,
193199 } ;
194200
@@ -207,7 +213,8 @@ pub(crate) async fn ipfs_command_handler(
207213
208214/// A handler for messages from the IPFS pubsub topic
209215pub ( super ) struct TopicMessageHandler < T >
210- where T : Fn ( hermes_ipfs:: rust_ipfs:: GossipsubMessage , String ) + Send + Sync + ' static
216+ where
217+ T : Fn ( hermes_ipfs:: rust_ipfs:: GossipsubMessage , String ) + Send + Sync + ' static ,
211218{
212219 /// The topic.
213220 topic : String ,
@@ -217,7 +224,8 @@ where T: Fn(hermes_ipfs::rust_ipfs::GossipsubMessage, String) + Send + Sync + 's
217224}
218225
219226impl < T > TopicMessageHandler < T >
220- where T : Fn ( hermes_ipfs:: rust_ipfs:: GossipsubMessage , String ) + Send + Sync + ' static
227+ where
228+ T : Fn ( hermes_ipfs:: rust_ipfs:: GossipsubMessage , String ) + Send + Sync + ' static ,
221229{
222230 /// Creates the new handler.
223231 pub fn new (
@@ -241,7 +249,8 @@ where T: Fn(hermes_ipfs::rust_ipfs::GossipsubMessage, String) + Send + Sync + 's
241249
242250/// A handler for subscribe/unsubscribe events from the IPFS pubsub topic
243251pub ( super ) struct TopicSubscriptionStatusHandler < T >
244- where T : Fn ( hermes_ipfs:: SubscriptionStatusEvent , String ) + Send + Sync + ' static
252+ where
253+ T : Fn ( hermes_ipfs:: SubscriptionStatusEvent , String ) + Send + Sync + ' static ,
245254{
246255 /// The topic.
247256 topic : String ,
@@ -251,7 +260,8 @@ where T: Fn(hermes_ipfs::SubscriptionStatusEvent, String) + Send + Sync + 'stati
251260}
252261
253262impl < T > TopicSubscriptionStatusHandler < T >
254- where T : Fn ( hermes_ipfs:: SubscriptionStatusEvent , String ) + Send + Sync + ' static
263+ where
264+ T : Fn ( hermes_ipfs:: SubscriptionStatusEvent , String ) + Send + Sync + ' static ,
255265{
256266 /// Creates the new handler.
257267 pub fn new (
0 commit comments