Skip to content

Commit b9e7066

Browse files
committed
Fix clippy errors
1 parent dfc222f commit b9e7066

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

jwt-authorizer/tests/tests.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -551,20 +551,15 @@ mod tests {
551551
async fn jwt_custom_token_extractor() {
552552
// Initialize custom token extractor
553553
let token_extractor: TokenExtractorFn = Arc::new(Box::new(|headers| {
554-
let Some(custom_header) = headers.get("X-Custom-Authorization") else {
555-
return None;
556-
};
554+
let custom_header = headers.get("X-Custom-Authorization")?;
557555

558556
let Ok(custom_header_str) = custom_header.to_str() else {
559557
return None;
560558
};
561559

562560
let token = custom_header_str.split("Bearer ");
563561

564-
match token.last() {
565-
Some(t) => Some(t.to_string()),
566-
None => None,
567-
}
562+
token.last().map(|t| t.to_string())
568563
}));
569564

570565
// OK

0 commit comments

Comments
 (0)