Skip to content

Commit b88e9ab

Browse files
authored
Fix clippy errors. (#512)
Signed-off-by: David Calavera <david.calavera@gmail.com> Signed-off-by: David Calavera <david.calavera@gmail.com>
1 parent 62660df commit b88e9ab

File tree

10 files changed

+25
-26
lines changed

10 files changed

+25
-26
lines changed

examples/basic-error-handling/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct Request {
1212
}
1313

1414
/// Event types that tell our Lambda what to do do.
15-
#[derive(Deserialize, PartialEq)]
15+
#[derive(Deserialize, Eq, PartialEq)]
1616
enum EventType {
1717
Response,
1818
ExternalError,

lambda-extension/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async-stream = "0.3"
1515
bytes = "1.0"
1616
chrono = { version = "0.4", features = ["serde"] }
1717
http = "0.2"
18-
hyper = { version = "0.14", features = ["http1", "client", "server", "stream", "runtime"] }
18+
hyper = { version = "0.14.20", features = ["http1", "client", "server", "stream", "runtime"] }
1919
lambda_runtime_api_client = { version = "0.6", path = "../lambda-runtime-api-client" }
2020
serde = { version = "1", features = ["derive"] }
2121
serde_json = "^1"

lambda-http/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ base64 = "0.13.0"
2424
bytes = "1"
2525
http = "0.2"
2626
http-body = "0.4"
27-
hyper = "0.14"
27+
hyper = "0.14.20"
2828
lambda_runtime = { path = "../lambda-runtime", version = "0.6" }
2929
serde = { version = "^1", features = ["derive"] }
3030
serde_json = "^1"

lambda-http/src/ext.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ mod tests {
328328

329329
#[test]
330330
fn requests_have_form_post_parsable_payloads() {
331-
#[derive(Deserialize, PartialEq, Debug)]
331+
#[derive(Deserialize, Eq, PartialEq, Debug)]
332332
struct Payload {
333333
foo: String,
334334
baz: usize,
@@ -349,7 +349,7 @@ mod tests {
349349

350350
#[test]
351351
fn requests_have_json_parseable_payloads() {
352-
#[derive(Deserialize, PartialEq, Debug)]
352+
#[derive(Deserialize, Eq, PartialEq, Debug)]
353353
struct Payload {
354354
foo: String,
355355
baz: usize,
@@ -370,7 +370,7 @@ mod tests {
370370

371371
#[test]
372372
fn requests_match_form_post_content_type_with_charset() {
373-
#[derive(Deserialize, PartialEq, Debug)]
373+
#[derive(Deserialize, Eq, PartialEq, Debug)]
374374
struct Payload {
375375
foo: String,
376376
baz: usize,
@@ -391,7 +391,7 @@ mod tests {
391391

392392
#[test]
393393
fn requests_match_json_content_type_with_charset() {
394-
#[derive(Deserialize, PartialEq, Debug)]
394+
#[derive(Deserialize, Eq, PartialEq, Debug)]
395395
struct Payload {
396396
foo: String,
397397
baz: usize,
@@ -412,7 +412,7 @@ mod tests {
412412

413413
#[test]
414414
fn requests_omiting_content_types_do_not_support_parseable_payloads() {
415-
#[derive(Deserialize, PartialEq, Debug)]
415+
#[derive(Deserialize, Eq, PartialEq, Debug)]
416416
struct Payload {
417417
foo: String,
418418
baz: usize,

lambda-http/src/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ pub enum RequestContext {
376376
}
377377

378378
/// Converts LambdaRequest types into `http::Request<Body>` types
379-
impl<'a> From<LambdaRequest> for http::Request<Body> {
379+
impl From<LambdaRequest> for http::Request<Body> {
380380
fn from(value: LambdaRequest) -> Self {
381381
match value {
382382
#[cfg(feature = "apigw_rest")]

lambda-runtime-api-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ readme = "README.md"
1212

1313
[dependencies]
1414
http = "0.2"
15-
hyper = { version = "0.14", features = ["http1", "client", "stream", "tcp"] }
15+
hyper = { version = "0.14.20", features = ["http1", "client", "stream", "tcp"] }
1616
tower-service = "0.3"
1717
tokio = { version = "1.0", features = ["io-util"] }

lambda-runtime/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ simulated = []
1717
[dependencies]
1818
tokio = { version = "1.0", features = ["macros", "io-util", "sync", "rt-multi-thread"] }
1919
# Hyper requires the `server` feature to work on nightly
20-
hyper = { version = "0.14", features = ["http1", "client", "stream", "server"] }
20+
hyper = { version = "0.14.20", features = ["http1", "client", "stream", "server"] }
2121
serde = { version = "1", features = ["derive"] }
2222
serde_json = "^1"
2323
bytes = "1.0"
@@ -27,4 +27,3 @@ tracing = { version = "0.1", features = ["log"] }
2727
tower = { version = "0.4", features = ["util"] }
2828
tokio-stream = "0.1.2"
2929
lambda_runtime_api_client = { version = "0.6", path = "../lambda-runtime-api-client" }
30-

lambda-runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub use types::{Context, LambdaEvent};
3131
pub type Error = lambda_runtime_api_client::Error;
3232

3333
/// Configuration derived from environment variables.
34-
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
34+
#[derive(Debug, Default, Clone, Eq, PartialEq, Serialize, Deserialize)]
3535
pub struct Config {
3636
/// The name of the function.
3737
pub function_name: String,

lambda-runtime/src/requests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) trait IntoResponse {
1414
}
1515

1616
// /runtime/invocation/next
17-
#[derive(Debug, PartialEq)]
17+
#[derive(Debug, Eq, PartialEq)]
1818
pub(crate) struct NextEventRequest;
1919

2020
impl IntoRequest for NextEventRequest {
@@ -27,7 +27,7 @@ impl IntoRequest for NextEventRequest {
2727
}
2828
}
2929

30-
#[derive(Debug, PartialEq)]
30+
#[derive(Debug, Eq, PartialEq)]
3131
pub struct NextEventResponse<'a> {
3232
// lambda-runtime-aws-request-id
3333
pub request_id: &'a str,

lambda-runtime/src/types.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use http::{HeaderMap, HeaderValue};
33
use serde::{Deserialize, Serialize};
44
use std::{collections::HashMap, convert::TryFrom};
55

6-
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
6+
#[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize)]
77
#[serde(rename_all = "camelCase")]
88
pub(crate) struct Diagnostic {
99
pub(crate) error_type: String,
@@ -28,33 +28,33 @@ fn round_trip_lambda_error() -> Result<(), Error> {
2828
/// The request ID, which identifies the request that triggered the function invocation. This header
2929
/// tracks the invocation within the Lambda control plane. The request ID is used to specify completion
3030
/// of a given invocation.
31-
#[derive(Debug, Clone, PartialEq)]
31+
#[derive(Debug, Clone, Eq, PartialEq)]
3232
pub struct RequestId(pub String);
3333

3434
/// The date that the function times out in Unix time milliseconds. For example, `1542409706888`.
35-
#[derive(Debug, Clone, PartialEq)]
35+
#[derive(Debug, Clone, Eq, PartialEq)]
3636
pub struct InvocationDeadline(pub u64);
3737

3838
/// The ARN of the Lambda function, version, or alias that is specified in the invocation.
3939
/// For instance, `arn:aws:lambda:us-east-2:123456789012:function:custom-runtime`.
40-
#[derive(Debug, Clone, PartialEq)]
40+
#[derive(Debug, Clone, Eq, PartialEq)]
4141
pub struct FunctionArn(pub String);
4242

4343
/// The AWS X-Ray Tracing header. For more information,
4444
/// please see [AWS' documentation](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader).
45-
#[derive(Debug, Clone, PartialEq)]
45+
#[derive(Debug, Clone, Eq, PartialEq)]
4646
pub struct XRayTraceId(pub String);
4747

4848
/// For invocations from the AWS Mobile SDK contains data about client application and device.
49-
#[derive(Debug, Clone, PartialEq)]
49+
#[derive(Debug, Clone, Eq, PartialEq)]
5050
struct MobileClientContext(String);
5151

5252
/// For invocations from the AWS Mobile SDK, data about the Amazon Cognito identity provider.
53-
#[derive(Debug, Clone, PartialEq)]
53+
#[derive(Debug, Clone, Eq, PartialEq)]
5454
struct MobileClientIdentity(String);
5555

5656
/// Client context sent by the AWS Mobile SDK.
57-
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
57+
#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)]
5858
pub struct ClientContext {
5959
/// Information about the mobile application invoking the function.
6060
#[serde(default)]
@@ -68,7 +68,7 @@ pub struct ClientContext {
6868
}
6969

7070
/// AWS Mobile SDK client fields.
71-
#[derive(Serialize, Deserialize, Default, Clone, Debug, PartialEq)]
71+
#[derive(Serialize, Deserialize, Default, Clone, Debug, Eq, PartialEq)]
7272
#[serde(rename_all = "camelCase")]
7373
pub struct ClientApplication {
7474
/// The mobile app installation id
@@ -84,7 +84,7 @@ pub struct ClientApplication {
8484
}
8585

8686
/// Cognito identity information sent with the event
87-
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
87+
#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)]
8888
pub struct CognitoIdentity {
8989
/// The unique identity id for the Cognito credentials invoking the function.
9090
pub identity_id: String,
@@ -96,7 +96,7 @@ pub struct CognitoIdentity {
9696
/// are populated using the [Lambda environment variables](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html)
9797
/// and the headers returned by the poll request to the Runtime APIs.
9898
#[non_exhaustive]
99-
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
99+
#[derive(Clone, Debug, Eq, PartialEq, Default, Serialize, Deserialize)]
100100
pub struct Context {
101101
/// The AWS request ID generated by the Lambda service.
102102
pub request_id: String,

0 commit comments

Comments
 (0)