Skip to content

Commit

Permalink
cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jxs committed Aug 12, 2023
1 parent 4c5cffc commit 68d3a84
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions beacon_node/lighthouse_network/src/discovery/enr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,27 +165,27 @@ pub fn create_enr_builder_from_config<T: EnrKey>(
builder.udp6(udp6_port);
}

// Add QUIC fields to the ENR.
// If `enable_libp2p` is disabled, then we should not support QUIC in the ENR either.
if enable_libp2p && !config.disable_quic_support {
// If we are listening on ipv4, add the quic ipv4 port
if let Some(quic4_port) = config
.enr_quic4_port
.or_else(|| config.listen_addrs().v4().map(|v4_addr| v4_addr.quic_port))
{
builder.add_value(QUIC_ENR_KEY, &quic4_port);
}
if enable_libp2p {
// Add QUIC fields to the ENR.
// If `enable_libp2p` is disabled, then we should not support QUIC in the ENR either.
if !config.disable_quic_support {
// If we are listening on ipv4, add the quic ipv4 port
if let Some(quic4_port) = config
.enr_quic4_port
.or_else(|| config.listen_addrs().v4().map(|v4_addr| v4_addr.quic_port))
{
builder.add_value(QUIC_ENR_KEY, &quic4_port);
}

// If we are listening on ipv6, add the quic ipv6 port
if let Some(quic6_port) = config
.enr_quic6_port
.or_else(|| config.listen_addrs().v6().map(|v6_addr| v6_addr.quic_port))
{
builder.add_value(QUIC6_ENR_KEY, &quic6_port);
// If we are listening on ipv6, add the quic ipv6 port
if let Some(quic6_port) = config
.enr_quic6_port
.or_else(|| config.listen_addrs().v6().map(|v6_addr| v6_addr.quic_port))
{
builder.add_value(QUIC6_ENR_KEY, &quic6_port);
}
}
}

if enable_libp2p {
// If the ENR port is not set, and we are listening over that ip version, use the listening port instead.
let tcp4_port = config
.enr_tcp4_port
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/lighthouse_network/src/service/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub fn build_transport(
transport.with_bandwidth_logging()
};

Ok((transport.boxed(), bandwidth))
Ok((transport, bandwidth))
}

// Useful helper functions for debugging. Currently not used in the client.
Expand Down

0 comments on commit 68d3a84

Please sign in to comment.