diff --git a/src/authority.rs b/src/authority.rs index 12b9ece..fc66126 100644 --- a/src/authority.rs +++ b/src/authority.rs @@ -344,8 +344,8 @@ where ) -> AuthResult> { match header_map.get(AUTHORIZATION).map(HeaderValue::to_str) { Some(Ok(header_value)) => { - let token_value = if header_value.strip_prefix("Bearer").is_some() { - header_value.trim() + let token_value = if let Some(token_value) = header_value.strip_prefix("Bearer") { + token_value.trim() } else { // to-do: better error handling return Err(AuthError::NoToken);