mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-11 09:07:44 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user