Skip to content

protocols/: Fix clippy and fmt warnings #2433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions protocols/gossipsub/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,11 @@ impl ProtocolsHandler for GossipsubHandler {

fn inject_fully_negotiated_inbound(
&mut self,
(substream, peer_kind): <Self::InboundProtocol as InboundUpgrade<NegotiatedSubstream>>::Output,
protocol: <Self::InboundProtocol as InboundUpgrade<NegotiatedSubstream>>::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;
Expand All @@ -233,9 +235,11 @@ impl ProtocolsHandler for GossipsubHandler {

fn inject_fully_negotiated_outbound(
&mut self,
(substream, peer_kind): <Self::OutboundProtocol as OutboundUpgrade<NegotiatedSubstream>>::Output,
protocol: <Self::OutboundProtocol as OutboundUpgrade<NegotiatedSubstream>>::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;
Expand Down
2 changes: 1 addition & 1 deletion protocols/mdns/src/behaviour/iface/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(()) => {
Expand Down