Skip to content

Commit 6137344

Browse files
committed
chore: run cargo clippy --fix
1 parent a881edb commit 6137344

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

lambda-events/src/encodings/http.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,39 +264,39 @@ mod tests {
264264
fn from_str() {
265265
match Body::from(String::from("foo").as_str()) {
266266
Body::Text(_) => (),
267-
not => panic!("expected Body::Text(...) got {:?}", not),
267+
not => panic!("expected Body::Text(...) got {not:?}"),
268268
}
269269
}
270270

271271
#[test]
272272
fn from_string() {
273273
match Body::from(String::from("foo")) {
274274
Body::Text(_) => (),
275-
not => panic!("expected Body::Text(...) got {:?}", not),
275+
not => panic!("expected Body::Text(...) got {not:?}"),
276276
}
277277
}
278278

279279
#[test]
280280
fn from_cow_str() {
281281
match Body::from(Cow::from("foo")) {
282282
Body::Text(_) => (),
283-
not => panic!("expected Body::Text(...) got {:?}", not),
283+
not => panic!("expected Body::Text(...) got {not:?}"),
284284
}
285285
}
286286

287287
#[test]
288288
fn from_cow_bytes() {
289289
match Body::from(Cow::from("foo".as_bytes())) {
290290
Body::Binary(_) => (),
291-
not => panic!("expected Body::Binary(...) got {:?}", not),
291+
not => panic!("expected Body::Binary(...) got {not:?}"),
292292
}
293293
}
294294

295295
#[test]
296296
fn from_bytes() {
297297
match Body::from("foo".as_bytes()) {
298298
Body::Binary(_) => (),
299-
not => panic!("expected Body::Binary(...) got {:?}", not),
299+
not => panic!("expected Body::Binary(...) got {not:?}"),
300300
}
301301
}
302302

@@ -325,12 +325,12 @@ mod tests {
325325
fn serialize_from_maybe_encoded() {
326326
match Body::from_maybe_encoded(false, "foo") {
327327
Body::Text(_) => (),
328-
not => panic!("expected Body::Text(...) got {:?}", not),
328+
not => panic!("expected Body::Text(...) got {not:?}"),
329329
}
330330

331331
match Body::from_maybe_encoded(true, "Zm9v") {
332332
Body::Binary(b) => assert_eq!(&[102, 111, 111], b.as_slice()),
333-
not => panic!("expected Body::Text(...) got {:?}", not),
333+
not => panic!("expected Body::Text(...) got {not:?}"),
334334
}
335335
}
336336
}

lambda-events/src/event/dynamodb/attributes.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mod test {
1515
let attr: AttributeValue = serde_json::from_value(value.clone()).unwrap();
1616
match attr {
1717
AttributeValue::Null(true) => {}
18-
other => panic!("unexpected value {:?}", other),
18+
other => panic!("unexpected value {other:?}"),
1919
}
2020

2121
let reparsed = serde_json::to_value(attr).unwrap();
@@ -31,7 +31,7 @@ mod test {
3131
let attr: AttributeValue = serde_json::from_value(value.clone()).unwrap();
3232
match attr {
3333
AttributeValue::S(ref s) => assert_eq!("value", s.as_str()),
34-
other => panic!("unexpected value {:?}", other),
34+
other => panic!("unexpected value {other:?}"),
3535
}
3636

3737
let reparsed = serde_json::to_value(attr).unwrap();
@@ -47,7 +47,7 @@ mod test {
4747
let attr: AttributeValue = serde_json::from_value(value.clone()).unwrap();
4848
match attr {
4949
AttributeValue::N(ref n) => assert_eq!("123.45", n.as_str()),
50-
other => panic!("unexpected value {:?}", other),
50+
other => panic!("unexpected value {other:?}"),
5151
}
5252

5353
let reparsed = serde_json::to_value(attr).unwrap();
@@ -68,7 +68,7 @@ mod test {
6868
.unwrap();
6969
assert_eq!(&expected, b)
7070
}
71-
other => panic!("unexpected value {:?}", other),
71+
other => panic!("unexpected value {other:?}"),
7272
}
7373

7474
let reparsed = serde_json::to_value(attr).unwrap();
@@ -84,7 +84,7 @@ mod test {
8484
let attr: AttributeValue = serde_json::from_value(value.clone()).unwrap();
8585
match attr {
8686
AttributeValue::Bool(b) => assert!(b),
87-
other => panic!("unexpected value {:?}", other),
87+
other => panic!("unexpected value {other:?}"),
8888
}
8989

9090
let reparsed = serde_json::to_value(attr).unwrap();
@@ -103,7 +103,7 @@ mod test {
103103
let expected = vec!["Giraffe", "Hippo", "Zebra"];
104104
assert_eq!(expected, s.iter().collect::<Vec<_>>());
105105
}
106-
other => panic!("unexpected value {:?}", other),
106+
other => panic!("unexpected value {other:?}"),
107107
}
108108

109109
let reparsed = serde_json::to_value(attr).unwrap();
@@ -122,7 +122,7 @@ mod test {
122122
let expected = vec!["42.2", "-19", "7.5", "3.14"];
123123
assert_eq!(expected, s.iter().collect::<Vec<_>>());
124124
}
125-
other => panic!("unexpected value {:?}", other),
125+
other => panic!("unexpected value {other:?}"),
126126
}
127127

128128
let reparsed = serde_json::to_value(attr).unwrap();
@@ -144,7 +144,7 @@ mod test {
144144
.collect::<Vec<_>>();
145145
assert_eq!(&expected, s);
146146
}
147-
other => panic!("unexpected value {:?}", other),
147+
other => panic!("unexpected value {other:?}"),
148148
}
149149

150150
let reparsed = serde_json::to_value(attr).unwrap();
@@ -167,7 +167,7 @@ mod test {
167167
];
168168
assert_eq!(&expected, s);
169169
}
170-
other => panic!("unexpected value {:?}", other),
170+
other => panic!("unexpected value {other:?}"),
171171
}
172172

173173
let reparsed = serde_json::to_value(attr).unwrap();
@@ -188,7 +188,7 @@ mod test {
188188
expected.insert("Age".into(), AttributeValue::N("35".into()));
189189
assert_eq!(expected, s);
190190
}
191-
other => panic!("unexpected value {:?}", other),
191+
other => panic!("unexpected value {other:?}"),
192192
}
193193
}
194194
}

lambda-events/src/event/sns/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ mod test {
412412
}
413413

414414
let parsed: SnsEventObj<CustStruct> = serde_json::from_slice(data).unwrap();
415-
println!("{:?}", parsed);
415+
println!("{parsed:?}");
416416

417417
assert_eq!(parsed.records[0].sns.message.foo, "Hello world!");
418418
assert_eq!(parsed.records[0].sns.message.bar, 123);

lambda-http/src/deserializer.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ mod tests {
6161
LambdaRequest::ApiGatewayV1(req) => {
6262
assert_eq!("12345678912", req.request_context.account_id.unwrap());
6363
}
64-
other => panic!("unexpected request variant: {:?}", other),
64+
other => panic!("unexpected request variant: {other:?}"),
6565
}
6666
}
6767

@@ -74,7 +74,7 @@ mod tests {
7474
LambdaRequest::ApiGatewayV2(req) => {
7575
assert_eq!("123456789012", req.request_context.account_id.unwrap());
7676
}
77-
other => panic!("unexpected request variant: {:?}", other),
77+
other => panic!("unexpected request variant: {other:?}"),
7878
}
7979
}
8080

@@ -87,7 +87,7 @@ mod tests {
8787
LambdaRequest::ApiGatewayV1(req) => {
8888
assert_eq!("123456789012", req.request_context.account_id.unwrap());
8989
}
90-
other => panic!("unexpected request variant: {:?}", other),
90+
other => panic!("unexpected request variant: {other:?}"),
9191
}
9292
}
9393

@@ -100,7 +100,7 @@ mod tests {
100100
LambdaRequest::ApiGatewayV2(req) => {
101101
assert_eq!("123456789012", req.request_context.account_id.unwrap());
102102
}
103-
other => panic!("unexpected request variant: {:?}", other),
103+
other => panic!("unexpected request variant: {other:?}"),
104104
}
105105
}
106106

@@ -118,7 +118,7 @@ mod tests {
118118
req.request_context.elb.target_group_arn.unwrap()
119119
);
120120
}
121-
other => panic!("unexpected request variant: {:?}", other),
121+
other => panic!("unexpected request variant: {other:?}"),
122122
}
123123
}
124124

@@ -132,7 +132,7 @@ mod tests {
132132
LambdaRequest::WebSocket(req) => {
133133
assert_eq!("CONNECT", req.request_context.event_type.unwrap());
134134
}
135-
other => panic!("unexpected request variant: {:?}", other),
135+
other => panic!("unexpected request variant: {other:?}"),
136136
}
137137
}
138138

lambda-runtime/src/runtime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ mod endpoint_tests {
369369
});
370370
let next_response = server.mock(|when, then| {
371371
when.method(POST)
372-
.path(format!("/2018-06-01/runtime/invocation/{}/response", request_id))
372+
.path(format!("/2018-06-01/runtime/invocation/{request_id}/response"))
373373
.body("{}");
374374
then.status(200).body("");
375375
});
@@ -440,7 +440,7 @@ mod endpoint_tests {
440440

441441
let next_response = server.mock(|when, then| {
442442
when.method(POST)
443-
.path(format!("/2018-06-01/runtime/invocation/{}/error", request_id))
443+
.path(format!("/2018-06-01/runtime/invocation/{request_id}/error"))
444444
.header("lambda-runtime-function-error-type", "unhandled");
445445
then.status(200).body("");
446446
});

0 commit comments

Comments
 (0)