Module reorganization and clippy cleanup

Move single-consumer modules into node/:
- rate_limit.rs, wire.rs, dns.rs — exclusively used by node subsystem
- Reduces top-level lib.rs from 16 to 13 modules

Split large files into focused subdirectories:
- noise.rs (1475 lines) → noise/{mod, handshake, session, replay, tests}.rs
- tree.rs (1479 lines) → tree/{mod, coordinate, declaration, state, tests}.rs
- bloom.rs (849 lines) → bloom/{mod, filter, state, tests}.rs
- All public APIs re-exported from mod.rs, no external import changes

Remove unused rate_limit defaults:
- HANDSHAKE_TIMEOUT_SECS, MAX_PENDING_INBOUND constants
- Default constructor eliminated in favor of with_params() taking config values

Fix all clippy warnings across codebase:
- Remove .clone() on Copy types, collapse nested ifs, replace match-return-None
  with ?, remove/gate unused code, fix loop indexing, remove unnecessary casts
- Box large PeerSlot enum variants to reduce size disparity
- cargo clippy --all-targets now reports zero warnings
This commit is contained in:
Johnathan Corgan
2026-02-15 15:07:42 +00:00
parent 89bc9cc4b0
commit b8a1f322c2
43 changed files with 3997 additions and 3981 deletions
+3 -3
View File
@@ -562,7 +562,7 @@ async fn test_routing_reachability_100_nodes() {
.collect();
for node in &mut nodes {
for &(ref addr, ref coords) in &all_coords {
for (addr, coords) in &all_coords {
if addr != node.node.node_addr() {
node.node.coord_cache_mut().insert(*addr, coords.clone(), now_ms);
}
@@ -696,7 +696,7 @@ async fn test_routing_stops_after_peer_removal() {
.collect();
for node in &mut nodes {
for &(ref addr, ref coords) in &all_coords {
for (addr, coords) in &all_coords {
if addr != node.node.node_addr() {
node.node.coord_cache_mut().insert(*addr, coords.clone(), now_ms);
}
@@ -931,7 +931,7 @@ async fn test_routing_source_only_coords_100_nodes() {
// Now compare: inject coords at ALL nodes (full cache) and verify 100%
for node in &mut nodes {
for &(ref addr, ref coords) in &all_coords {
for (addr, coords) in &all_coords {
if addr != node.node.node_addr() {
node.node.coord_cache_mut().insert(*addr, coords.clone(), now_ms);
}