Skip to content

Commit 1231e8c

Browse files
committed
Fix nits
1 parent f40cfa1 commit 1231e8c

10 files changed

Lines changed: 290 additions & 377 deletions

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ members = [
77
"lambda-runtime",
88
"lambda-extension",
99
"lambda-events",
10+
"lambda-events/lambda-events-examples",
1011
]
1112

1213
exclude = ["examples"]

lambda-events/README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cargo add aws_lambda_events --no-default-features --features apigw,alb
2929

3030
### Builder pattern support
3131

32-
The crate provides an optional `builders` feature that adds builder pattern support for event types using the [bon](https://crates.io/crates/bon) crate. This enables type-safe, immutable construction of event responses with a clean, ergonomic API.
32+
The crate provides an optional `builders` feature that adds builder pattern support for event types. This enables type-safe, immutable construction of event responses with a clean, ergonomic API.
3333

3434
Enable the builders feature:
3535

@@ -69,12 +69,6 @@ async fn handler(
6969
}
7070
```
7171

72-
Key benefits of bon builders:
73-
- **Clean API**: `Struct::builder().field().build()` - no `.unwrap()` or `?` needed
74-
- **Automatic Option handling**: Optional fields don't need to be explicitly set
75-
- **Type safety**: Compile-time validation of required fields
76-
- **Ergonomic**: Minimal configuration required
77-
7872
See the [examples directory](https://github.com/aws/aws-lambda-rust-runtime/tree/main/lambda-events/examples) for more builder pattern examples.
7973

8074
## History

lambda-events/examples/comprehensive-builders.rs

Lines changed: 0 additions & 44 deletions
This file was deleted.

lambda-events/examples/lambda-runtime-authorizer-builder.rs

Lines changed: 0 additions & 145 deletions
This file was deleted.

lambda-events/examples/lambda-runtime-sqs-batch-builder.rs

Lines changed: 0 additions & 135 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[package]
2+
name = "lambda-events-examples"
3+
version = "0.1.0"
4+
edition = "2021"
5+
publish = false
6+
7+
[dependencies]
8+
aws_lambda_events = { path = "..", features = ["builders"] }
9+
lambda_runtime = { path = "../../lambda-runtime" }
10+
serde = { version = "1", features = ["derive"] }
11+
serde_json = "1"
12+
chrono = { version = "0.4", default-features = false, features = ["clock"] }
13+
serde_dynamo = "4"
14+
15+
[[example]]
16+
name = "comprehensive-builders"
17+
path = "examples/comprehensive-builders.rs"
18+
19+
[[example]]
20+
name = "lambda-runtime-authorizer-builder"
21+
path = "examples/lambda-runtime-authorizer-builder.rs"
22+
23+
[[example]]
24+
name = "lambda-runtime-sqs-batch-builder"
25+
path = "examples/lambda-runtime-sqs-batch-builder.rs"

0 commit comments

Comments
 (0)