@@ -157,8 +157,8 @@ enum PublishConfig {
157157impl PublishConfig {
158158 pub fn get_own_id ( & self ) -> Option < & PeerId > {
159159 match self {
160- Self :: Signing { author, .. } => Some ( & author) ,
161- Self :: Author ( author) => Some ( & author) ,
160+ Self :: Signing { author, .. } => Some ( author) ,
161+ Self :: Author ( author) => Some ( author) ,
162162 _ => None ,
163163 }
164164 }
@@ -381,7 +381,7 @@ where
381381
382382 // We do not allow configurations where a published message would also be rejected if it
383383 // were received locally.
384- validate_config ( & privacy, & config. validation_mode ( ) ) ?;
384+ validate_config ( & privacy, config. validation_mode ( ) ) ?;
385385
386386 // Set up message publishing parameters.
387387
@@ -990,7 +990,7 @@ where
990990 get_random_peers (
991991 & self . topic_peers ,
992992 & self . connected_peers ,
993- & topic_hash,
993+ topic_hash,
994994 self . config . prune_peers ( ) ,
995995 |p| p != peer && !self . score_below_threshold ( p, |_| 0.0 ) . 0 ,
996996 )
@@ -1337,7 +1337,7 @@ where
13371337 * peer_id,
13381338 vec ! [ & topic_hash] ,
13391339 & self . mesh ,
1340- self . peer_topics . get ( & peer_id) ,
1340+ self . peer_topics . get ( peer_id) ,
13411341 & mut self . events ,
13421342 & self . connected_peers ,
13431343 ) ;
@@ -1396,7 +1396,7 @@ where
13961396 always_update_backoff : bool ,
13971397 ) {
13981398 let mut update_backoff = always_update_backoff;
1399- if let Some ( peers) = self . mesh . get_mut ( & topic_hash) {
1399+ if let Some ( peers) = self . mesh . get_mut ( topic_hash) {
14001400 // remove the peer if it exists in the mesh
14011401 if peers. remove ( peer_id) {
14021402 debug ! (
@@ -1416,7 +1416,7 @@ where
14161416 * peer_id,
14171417 topic_hash,
14181418 & self . mesh ,
1419- self . peer_topics . get ( & peer_id) ,
1419+ self . peer_topics . get ( peer_id) ,
14201420 & mut self . events ,
14211421 & self . connected_peers ,
14221422 ) ;
@@ -1429,7 +1429,7 @@ where
14291429 self . config . prune_backoff ( )
14301430 } ;
14311431 // is there a backoff specified by the peer? if so obey it.
1432- self . backoffs . update_backoff ( & topic_hash, peer_id, time) ;
1432+ self . backoffs . update_backoff ( topic_hash, peer_id, time) ;
14331433 }
14341434 }
14351435
@@ -1570,7 +1570,7 @@ where
15701570 own_id != propagation_source
15711571 && raw_message. source . as_ref ( ) . map_or ( false , |s| s == own_id)
15721572 } else {
1573- self . published_message_ids . contains ( & msg_id)
1573+ self . published_message_ids . contains ( msg_id)
15741574 } ;
15751575
15761576 if self_published {
@@ -2176,7 +2176,7 @@ where
21762176 "HEARTBEAT: Fanout topic removed due to timeout. Topic: {:?}" ,
21772177 topic_hash
21782178 ) ;
2179- fanout. remove ( & topic_hash) ;
2179+ fanout. remove ( topic_hash) ;
21802180 return false ;
21812181 }
21822182 true
@@ -2195,7 +2195,7 @@ where
21952195 // is the peer still subscribed to the topic?
21962196 match self . peer_topics . get ( peer) {
21972197 Some ( topics) => {
2198- if !topics. contains ( & topic_hash) || score ( peer) < publish_threshold {
2198+ if !topics. contains ( topic_hash) || score ( peer) < publish_threshold {
21992199 debug ! (
22002200 "HEARTBEAT: Peer removed from fanout for topic: {:?}" ,
22012201 topic_hash
@@ -2291,7 +2291,7 @@ where
22912291 fn emit_gossip ( & mut self ) {
22922292 let mut rng = thread_rng ( ) ;
22932293 for ( topic_hash, peers) in self . mesh . iter ( ) . chain ( self . fanout . iter ( ) ) {
2294- let mut message_ids = self . mcache . get_gossip_message_ids ( & topic_hash) ;
2294+ let mut message_ids = self . mcache . get_gossip_message_ids ( topic_hash) ;
22952295 if message_ids. is_empty ( ) {
22962296 return ;
22972297 }
@@ -2319,7 +2319,7 @@ where
23192319 let to_msg_peers = get_random_peers_dynamic (
23202320 & self . topic_peers ,
23212321 & self . connected_peers ,
2322- & topic_hash,
2322+ topic_hash,
23232323 n_map,
23242324 |peer| {
23252325 !peers. contains ( peer)
@@ -2438,7 +2438,7 @@ where
24382438 * peer,
24392439 topic_hash,
24402440 & self . mesh ,
2441- self . peer_topics . get ( & peer) ,
2441+ self . peer_topics . get ( peer) ,
24422442 & mut self . events ,
24432443 & self . connected_peers ,
24442444 ) ;
@@ -2483,7 +2483,7 @@ where
24832483 // add mesh peers
24842484 let topic = & message. topic ;
24852485 // mesh
2486- if let Some ( mesh_peers) = self . mesh . get ( & topic) {
2486+ if let Some ( mesh_peers) = self . mesh . get ( topic) {
24872487 for peer_id in mesh_peers {
24882488 if Some ( peer_id) != propagation_source && Some ( peer_id) != message. source . as_ref ( ) {
24892489 recipient_peers. insert ( * peer_id) ;
@@ -2877,13 +2877,13 @@ where
28772877 // remove peer from all mappings
28782878 for topic in topics {
28792879 // check the mesh for the topic
2880- if let Some ( mesh_peers) = self . mesh . get_mut ( & topic) {
2880+ if let Some ( mesh_peers) = self . mesh . get_mut ( topic) {
28812881 // check if the peer is in the mesh and remove it
28822882 mesh_peers. remove ( peer_id) ;
28832883 }
28842884
28852885 // remove from topic_peers
2886- if let Some ( peer_list) = self . topic_peers . get_mut ( & topic) {
2886+ if let Some ( peer_list) = self . topic_peers . get_mut ( topic) {
28872887 if !peer_list. remove ( peer_id) {
28882888 // debugging purposes
28892889 warn ! (
@@ -2900,7 +2900,7 @@ where
29002900
29012901 // remove from fanout
29022902 self . fanout
2903- . get_mut ( & topic)
2903+ . get_mut ( topic)
29042904 . map ( |peers| peers. remove ( peer_id) ) ;
29052905 }
29062906 }
@@ -2943,7 +2943,7 @@ where
29432943 // Add the IP to the peer scoring system
29442944 if let Some ( ( peer_score, ..) ) = & mut self . peer_score {
29452945 if let Some ( ip) = get_ip_addr ( endpoint. get_remote_address ( ) ) {
2946- peer_score. add_ip ( & peer_id, ip) ;
2946+ peer_score. add_ip ( peer_id, ip) ;
29472947 } else {
29482948 trace ! (
29492949 "Couldn't extract ip from endpoint of peer {} with endpoint {:?}" ,
@@ -3041,7 +3041,7 @@ where
30413041 )
30423042 }
30433043 if let Some ( ip) = get_ip_addr ( endpoint_new. get_remote_address ( ) ) {
3044- peer_score. add_ip ( & peer, ip) ;
3044+ peer_score. add_ip ( peer, ip) ;
30453045 } else {
30463046 trace ! (
30473047 "Couldn't extract ip from endpoint of peer {} with endpoint {:?}" ,
0 commit comments