Skip to content

Commit a20193d

Browse files
authored
fix clippy warnings in unit tests (#513)
not sure if there's a way for `cargo clippy` to lint the tests by default...
1 parent b88e9ab commit a20193d

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

lambda-http/src/request.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,7 @@ mod tests {
472472
// Ensure this is an APIGWv2 request
473473
let req_context = req.request_context();
474474
assert!(
475-
match req_context {
476-
RequestContext::ApiGatewayV2(_) => true,
477-
_ => false,
478-
},
475+
matches!(req_context, RequestContext::ApiGatewayV2(_)),
479476
"expected ApiGatewayV2 context, got {:?}",
480477
req_context
481478
);
@@ -507,10 +504,7 @@ mod tests {
507504
// Ensure this is an APIGWv2 request
508505
let req_context = req.request_context();
509506
assert!(
510-
match req_context {
511-
RequestContext::ApiGatewayV2(_) => true,
512-
_ => false,
513-
},
507+
matches!(req_context, RequestContext::ApiGatewayV2(_)),
514508
"expected ApiGatewayV2 context, got {:?}",
515509
req_context
516510
);
@@ -539,10 +533,7 @@ mod tests {
539533
// Ensure this is an APIGW request
540534
let req_context = req.request_context();
541535
assert!(
542-
match req_context {
543-
RequestContext::ApiGatewayV1(_) => true,
544-
_ => false,
545-
},
536+
matches!(req_context, RequestContext::ApiGatewayV1(_)),
546537
"expected ApiGateway context, got {:?}",
547538
req_context
548539
);
@@ -570,10 +561,7 @@ mod tests {
570561
// Ensure this is an ALB request
571562
let req_context = req.request_context();
572563
assert!(
573-
match req_context {
574-
RequestContext::Alb(_) => true,
575-
_ => false,
576-
},
564+
matches!(req_context, RequestContext::Alb(_)),
577565
"expected Alb context, got {:?}",
578566
req_context
579567
);

0 commit comments

Comments
 (0)