修复所有lint警告和错误

This commit is contained in:
xintaofei
2026-03-26 21:47:13 +08:00
parent 5e5c48338b
commit f61f9fb025
20 changed files with 138 additions and 93 deletions

View File

@@ -20,7 +20,7 @@ pub async fn require_token(
// Check Authorization header
if let Some(auth_header) = request.headers().get("authorization") {
if let Ok(auth_str) = auth_header.to_str() {
if auth_str.strip_prefix("Bearer ").map_or(false, |t| t == token) {
if auth_str.strip_prefix("Bearer ").is_some_and(|t| t == token) {
return next.run(request).await;
}
}