style: use rsplit+find instead of filter+last to satisfy clippy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
whit3rabbit
2026-03-28 18:35:14 -05:00
co-authored by Claude Opus 4.6
parent ea3580fe2e
commit e13610667d
+2 -3
View File
@@ -530,10 +530,9 @@ pub async fn check_ip_allowlist(request: Request<Body>, next: Next) -> Result<Re
.get("x-forwarded-for")
.and_then(|v| v.to_str().ok())
.and_then(|s| {
s.split(',')
s.rsplit(',')
.map(|p| p.trim())
.filter(|p| !p.is_empty())
.last()
.find(|p| !p.is_empty())
})
.and_then(|s| s.parse::<std::net::IpAddr>().ok())
} else {