Skip to content
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

impl Display for generated (string) enums #3336

Closed
rcoh opened this issue Dec 20, 2023 · 2 comments
Closed

impl Display for generated (string) enums #3336

rcoh opened this issue Dec 20, 2023 · 2 comments
Labels
good first issue Good for newcomers

Comments

@rcoh
Copy link
Collaborator

rcoh commented Dec 20, 2023

as_str exists, but we might as well impl Display with identical behavior since these are thin string wrappers

@rcoh rcoh added the good first issue Good for newcomers label Dec 20, 2023
@rcoh
Copy link
Collaborator Author

rcoh commented Dec 20, 2023

If you'd like to take on this issue, the relevant code appears to be here:

override fun additionalEnumImpls(context: EnumGeneratorContext): Writable =

@iampkmone
Copy link
Contributor

Will send a PR.

github-merge-queue bot pushed a commit that referenced this issue Feb 7, 2024
## Motivation and Context
This change address the
[#3335](#3336)

## Description
Added Display trait to the Enum. 

## Testing
Updated the
[ClientEnumGeneratorTest.kt](https://github.com/smithy-lang/smithy-rs/blob/main/codegen-client/src/test/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/ClientEnumGeneratorTest.kt)
which test the ```impl Display``` for the enums.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

Co-authored-by: Prince Kumar Maurya <[email protected]>
@jdisanti jdisanti closed this as completed Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants