From 4e54da19159e0f7cfc887826165ca137f31a9f2d Mon Sep 17 00:00:00 2001 From: elenaf9 Date: Thu, 13 Jan 2022 19:04:51 +0100 Subject: [PATCH 1/2] protocols/mdns: fix clippy::to-string-in-format-args --- protocols/mdns/src/behaviour/iface/dns.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/mdns/src/behaviour/iface/dns.rs b/protocols/mdns/src/behaviour/iface/dns.rs index 78b8f9e7c57..5bb190f4c2c 100644 --- a/protocols/mdns/src/behaviour/iface/dns.rs +++ b/protocols/mdns/src/behaviour/iface/dns.rs @@ -127,7 +127,7 @@ pub fn build_query_response( // Encode the addresses as TXT records, and multiple TXT records into a // response packet. for addr in addresses { - let txt_to_send = format!("dnsaddr={}/p2p/{}", addr.to_string(), peer_id.to_base58()); + let txt_to_send = format!("dnsaddr={}/p2p/{}", addr, peer_id.to_base58()); let mut txt_record = Vec::with_capacity(txt_to_send.len()); match append_txt_record(&mut txt_record, &peer_name_bytes, ttl, &txt_to_send) { Ok(()) => { From 4fbaa2d9673eb8970d1d95f57261b03a4a5d6dd9 Mon Sep 17 00:00:00 2001 From: elenaf9 Date: Thu, 13 Jan 2022 19:09:35 +0100 Subject: [PATCH 2/2] protocols/gossipsub: fix rustfmt error --- protocols/gossipsub/src/handler.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/protocols/gossipsub/src/handler.rs b/protocols/gossipsub/src/handler.rs index 592c5b409c4..7fc1bd43925 100644 --- a/protocols/gossipsub/src/handler.rs +++ b/protocols/gossipsub/src/handler.rs @@ -211,9 +211,11 @@ impl ProtocolsHandler for GossipsubHandler { fn inject_fully_negotiated_inbound( &mut self, - (substream, peer_kind): >::Output, + protocol: >::Output, _info: Self::InboundOpenInfo, ) { + let (substream, peer_kind) = protocol; + // If the peer doesn't support the protocol, reject all substreams if self.protocol_unsupported { return; @@ -233,9 +235,11 @@ impl ProtocolsHandler for GossipsubHandler { fn inject_fully_negotiated_outbound( &mut self, - (substream, peer_kind): >::Output, + protocol: >::Output, message: Self::OutboundOpenInfo, ) { + let (substream, peer_kind) = protocol; + // If the peer doesn't support the protocol, reject all substreams if self.protocol_unsupported { return;