fix(lambda-events): impl Default for all Kinesis Event structs #1011
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📬 Issue #, if available:
I chatted with @jlizen after she opened #1009.
For testing ergonomics, it makes sense to implement
Default
on all of the structs in Kinesis Events. This PR is a follow up to #1008, and implementsDefault
for all the KinesisEvent-related structs.✍️ Description of changes:
Implement
Default
on allKinesisEvent
-related structs.I also changed the test that I merged in in the last PR. At first glance, this test feels unnecessary because it is not actually making any assertions. However, because
cargo lambda init
generates code that inherently relies onDefault
being implemented on these structs, I think a unit test that attempts to exercise that code path is worthwhile. Theoretically, the test can never fail at runtime, only compile time.This test will protect against breaking
cargo lambda init
's autogenerated code in the absence of E2E tests.🔏 By submitting this pull request
cargo +nightly fmt
.cargo clippy --fix
.