We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
clippy
1 parent 6239f57 commit 7fc1c4eCopy full SHA for 7fc1c4e
openapi-lambda/src/lib.rs
@@ -34,16 +34,13 @@ pub type HttpResponse = Response<Body>;
34
/// Serialize an [`HttpResponse`] as an [`ApiGatewayProxyResponse`].
35
pub fn http_response_to_apigw(response: HttpResponse) -> ApiGatewayProxyResponse {
36
let (parts, body) = response.into_parts();
37
- let is_base64_encoded = match body {
38
- Body::Binary(_) => true,
39
- _ => false,
40
- };
+ let is_base64_encoded = matches!(body, Body::Binary(_));
41
ApiGatewayProxyResponse {
42
status_code: parts.status.as_u16() as i64,
43
headers: Default::default(),
44
multi_value_headers: parts.headers,
45
body: Some(body),
46
- is_base64_encoded: is_base64_encoded,
+ is_base64_encoded,
47
}
48
49
0 commit comments