clippy fixes and cleanup

This commit is contained in:
Christien Rioux 2024-03-29 21:12:36 -04:00
parent ab276de977
commit 4a4271db61
3 changed files with 6 additions and 16 deletions

View File

@ -166,13 +166,9 @@ impl ConnectionManager {
let netman = self.network_manager(); let netman = self.network_manager();
let routing_table = netman.routing_table(); let routing_table = netman.routing_table();
let remote_address = conn.flow().remote_address().address(); let remote_address = conn.flow().remote_address().address();
let Some(routing_domain) = routing_table.routing_domain_for_address(remote_address) else { let routing_domain = routing_table.routing_domain_for_address(remote_address)?;
return None; let relay_node = routing_table.relay_node(routing_domain)?;
}; let relay_nr = relay_node.filtered_clone(
let Some(rn) = routing_table.relay_node(routing_domain) else {
return None;
};
let relay_nr = rn.filtered_clone(
NodeRefFilter::new() NodeRefFilter::new()
.with_routing_domain(routing_domain) .with_routing_domain(routing_domain)
.with_address_type(conn.flow().address_type()) .with_address_type(conn.flow().address_type())

View File

@ -340,17 +340,14 @@ impl DiscoveryContext {
tries += 1; tries += 1;
// Attempt a port mapping. If this doesn't succeed, it's not going to // Attempt a port mapping. If this doesn't succeed, it's not going to
let Some(mapped_external_address) = igd_manager let mapped_external_address = igd_manager
.map_any_port( .map_any_port(
low_level_protocol_type, low_level_protocol_type,
address_type, address_type,
local_port, local_port,
Some(external_1.address.ip_addr()), Some(external_1.address.ip_addr()),
) )
.await .await?;
else {
return None;
};
// Make dial info from the port mapping // Make dial info from the port mapping
let external_mapped_dial_info = self.unlocked_inner.net.make_dial_info( let external_mapped_dial_info = self.unlocked_inner.net.make_dial_info(

View File

@ -239,10 +239,7 @@ fn get_destination(
let private_route = if let Some(prid) = get_route_id(rss.clone(), false, true)(text) let private_route = if let Some(prid) = get_route_id(rss.clone(), false, true)(text)
{ {
let Some(private_route) = rss.best_remote_private_route(&prid) else { rss.best_remote_private_route(&prid)?
return None;
};
private_route
} else { } else {
let mut dc = DEBUG_CACHE.lock(); let mut dc = DEBUG_CACHE.lock();
let n = get_number(text)?; let n = get_number(text)?;