From c9f6fab746106b4f76898d765061471e7f3127ef Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Wed, 30 Jul 2025 20:03:24 -0400 Subject: [PATCH] Warning fix --- src/auth.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth.rs b/src/auth.rs index 08f4ae7..6774026 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -69,8 +69,8 @@ pub async fn auth( .get(axum::http::header::AUTHORIZATION) .and_then(|auth_header| auth_header.to_str().ok()) .and_then(|auth_value| { - if auth_value.starts_with("Bearer ") { - Some(auth_value[7..].to_owned()) + if let Some(stripped) = auth_value.strip_prefix("Bearer ") { + Some(String::from(stripped)) } else { None }