clippy work

This commit is contained in:
Christien Rioux
2023-09-17 19:37:02 -04:00
parent 8a1260ed48
commit 6438a64fc7
62 changed files with 414 additions and 310 deletions

View File

@@ -327,7 +327,7 @@ impl RoutingTable {
}
}
}
if bootstrap_dialinfos.len() > 0 {
if !bootstrap_dialinfos.is_empty() {
return self
.direct_bootstrap_task_routine(stop_token, bootstrap_dialinfos)
.await;

View File

@@ -78,8 +78,11 @@ impl RoutingTable {
// Save up to N unpublished routes and test them
let background_safety_route_count = self.get_background_safety_route_count();
for x in 0..(usize::min(background_safety_route_count, unpublished_routes.len())) {
must_test_routes.push(unpublished_routes[x].0);
for unpublished_route in unpublished_routes.iter().take(usize::min(
background_safety_route_count,
unpublished_routes.len(),
)) {
must_test_routes.push(unpublished_route.0);
}
// Kill off all but N unpublished routes rather than testing them
@@ -225,9 +228,9 @@ impl RoutingTable {
let remote_routes_needing_testing = rss.list_remote_routes(|k, v| {
let stats = v.get_stats();
if stats.needs_testing(cur_ts) {
return Some(*k);
Some(*k)
} else {
return None;
None
}
});
if !remote_routes_needing_testing.is_empty() {