Skip to content

fix(lambda-events): impl Default for all Kinesis Event structs #1011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

sdstolworthy
Copy link
Contributor

📬 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 implements Default for all the KinesisEvent-related structs.

✍️ Description of changes:
Implement Default on all KinesisEvent-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 on Default 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

  • I confirm that I've ran cargo +nightly fmt.
  • I confirm that I've ran cargo clippy --fix.
  • I confirm that I've made a best effort attempt to update all relevant documentation.
  • I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@jlizen jlizen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jlizen jlizen merged commit 35860b0 into awslabs:main Jul 10, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants