From c597ec2bc196fbe29c79fafe6bbef1e5b115b75e Mon Sep 17 00:00:00 2001 From: epi <43392618+epi052@users.noreply.github.com> Date: Sun, 16 Nov 2025 09:10:10 -0500 Subject: [PATCH] clippy/fmt --- src/scan_manager/scan.rs | 2 +- src/scanner/requester.rs | 6 +++--- tests/test_rate_limiting_harness.rs | 8 -------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/scan_manager/scan.rs b/src/scan_manager/scan.rs index 3b1562c..7644add 100644 --- a/src/scan_manager/scan.rs +++ b/src/scan_manager/scan.rs @@ -674,7 +674,7 @@ mod tests { // allow for timing imprecision: sleep overhead makes elapsed time slightly > 1 second // e.g., 100 reqs / 1.01s = 99 req/s assert!( - req_sec >= 99 && req_sec <= 101, + (99..=101).contains(&req_sec), "Expected ~100 req/s, got {}", req_sec ); diff --git a/src/scanner/requester.rs b/src/scanner/requester.rs index 49b9510..e3d49a9 100644 --- a/src/scanner/requester.rs +++ b/src/scanner/requester.rs @@ -1236,7 +1236,7 @@ mod tests { let original = requester.policy_data.heap.read().unwrap().original; // Allow for timing imprecision: 400 reqs / 1.01s elapsed = 399 req/s assert!( - original >= 399 && original <= 401, + (399..=401).contains(&original), "Expected ~400 req/s original, got {}", original ); @@ -1244,14 +1244,14 @@ mod tests { let limit = requester.policy_data.get_limit(); // Limit is original/2, so with original 399-401, limit is 199-200 assert!( - limit >= 199 && limit <= 201, + (199..=201).contains(&limit), "Expected limit ~200, got {}", limit ); let rate_limiter_max = requester.rate_limiter.read().await.as_ref().unwrap().max(); assert!( - rate_limiter_max >= 199 && rate_limiter_max <= 201, + (199..=201).contains(&rate_limiter_max), "Expected rate limiter max ~200, got {}", rate_limiter_max ); diff --git a/tests/test_rate_limiting_harness.rs b/tests/test_rate_limiting_harness.rs index 9313824..e3c821f 100644 --- a/tests/test_rate_limiting_harness.rs +++ b/tests/test_rate_limiting_harness.rs @@ -1,11 +1,3 @@ -/// Rate Limiting Test Harness -/// -/// This provides controllable mock server scenarios to test rate limiting behavior. -/// -/// Run with: cargo test --test test_rate_limiting_harness -- --nocapture -/// -/// Each test demonstrates a different rate limiting scenario and can be run independently - mod utils; use assert_cmd::Command;