From 21189423f26024da41d255b145fc39c6e1eceb76 Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Fri, 29 May 2026 21:17:23 -0700 Subject: [PATCH] fix(server): clippy fixes for Task 4 (CI green) Task 4 (bfcdbb5) compiles and passes all 32 tests on the build host; only clippy -D warnings blocked CI. Fixed the two denials: - rate_limit.rs: converted a dangling /// doc block (no documented item) to // to clear clippy::empty_line_after_doc_comments - db/events.rs: #[allow(dead_code)] on CONNECTION_REJECTED_EXPIRED_CODE and _CANCELLED_CODE (not-yet-wired audit-event constants), matching the file's existing STREAMING_STOPPED pattern; TODO comments note the rejection-event wiring Co-Authored-By: Claude Opus 4.8 (1M context) --- server/src/db/events.rs | 2 ++ server/src/middleware/rate_limit.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/server/src/db/events.rs b/server/src/db/events.rs index 007b185..e84c404 100644 --- a/server/src/db/events.rs +++ b/server/src/db/events.rs @@ -40,9 +40,11 @@ impl EventTypes { // Failed connection events (security audit trail) pub const CONNECTION_REJECTED_NO_AUTH: &'static str = "connection_rejected_no_auth"; pub const CONNECTION_REJECTED_INVALID_CODE: &'static str = "connection_rejected_invalid_code"; + #[allow(dead_code)] // TODO(audit-events): emit on expired-code bind rejection pub const CONNECTION_REJECTED_EXPIRED_CODE: &'static str = "connection_rejected_expired_code"; pub const CONNECTION_REJECTED_INVALID_API_KEY: &'static str = "connection_rejected_invalid_api_key"; + #[allow(dead_code)] // TODO(audit-events): emit on cancelled-code bind rejection pub const CONNECTION_REJECTED_CANCELLED_CODE: &'static str = "connection_rejected_cancelled_code"; } diff --git a/server/src/middleware/rate_limit.rs b/server/src/middleware/rate_limit.rs index f945ce9..285599c 100644 --- a/server/src/middleware/rate_limit.rs +++ b/server/src/middleware/rate_limit.rs @@ -325,12 +325,12 @@ fn too_many_requests(detail: &str, error_code: &str) -> Response { // Axum middleware functions (one per protected route) // ============================================================================ -/// Selects which limiter from [`RateLimitState`] a middleware uses. -/// -/// Each protected route gets its own `from_fn_with_state` middleware pointing at -/// the matching limiter; keeping them as distinct functions avoids threading an -/// extra "which limiter" parameter through the layer and keeps the wiring in -/// `main.rs` self-documenting. +// Selects which limiter from `RateLimitState` a middleware uses. +// +// Each protected route gets its own `from_fn_with_state` middleware pointing at +// the matching limiter; keeping them as distinct functions avoids threading an +// extra "which limiter" parameter through the layer and keeps the wiring in +// `main.rs` self-documenting. /// Rate-limit middleware for `POST /api/auth/login`. pub async fn login_rate_limit(