From d73065e06bae1537789503ab42f7ef16ef306f4c Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 10 Jun 2026 11:51:56 +0000 Subject: [PATCH] style: apply rustfmt to login-lockout code merged in #326 Same whitespace-only reformat as branch claude/jolly-johnson-yso7z7: PR #326 landed three files that fail cargo fmt --check and its CI run skipped the Rustfmt job, breaking the check for every later Rust PR. https://claude.ai/code/session_01GpprjxjtXFYLfXNkoKnHuL --- src/interfaces/api/handlers/auth_handler.rs | 5 +---- src/interfaces/middleware/trusted_proxy.rs | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/interfaces/api/handlers/auth_handler.rs b/src/interfaces/api/handlers/auth_handler.rs index 1261558e..64556952 100644 --- a/src/interfaces/api/handlers/auth_handler.rs +++ b/src/interfaces/api/handlers/auth_handler.rs @@ -290,10 +290,7 @@ pub async fn login( // same account from a different address (issue #323). The check runs // BEFORE Argon2 to save CPU under brute-force attacks. let client_ip = client_ip_from_parts(&headers, Some(peer), false); - if let Err(lockout_secs) = auth_service - .login_lockout - .check(&dto.username, &client_ip) - { + if let Err(lockout_secs) = auth_service.login_lockout.check(&dto.username, &client_ip) { tracing::warn!( target: "audit", event = "auth.login", diff --git a/src/interfaces/middleware/trusted_proxy.rs b/src/interfaces/middleware/trusted_proxy.rs index 0330e10d..d6bb6310 100644 --- a/src/interfaces/middleware/trusted_proxy.rs +++ b/src/interfaces/middleware/trusted_proxy.rs @@ -158,9 +158,7 @@ pub fn client_ip_from_parts( if let Some(peer_addr) = peer { if is_trusted_proxy(peer_addr.ip()) { // Try X-Forwarded-For first (leftmost = original client) - if let Some(xff) = headers - .get("x-forwarded-for") - .and_then(|v| v.to_str().ok()) + if let Some(xff) = headers.get("x-forwarded-for").and_then(|v| v.to_str().ok()) && let Some(ip) = xff .split(',') .next()