-
Notifications
You must be signed in to change notification settings - Fork 190
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
Fix bug where string builtIns were not supported #2150
Conversation
2922165
to
ce27b3d
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
rustBlockTemplate("#{Params}", "Params" to paramsStruct()) { | ||
parameters.toList().forEach { parameter -> | ||
rust("${parameter.memberName()}: self.${parameter.memberName()}") | ||
parameter.default.orNull()?.also { default -> rust(".or(Some(${value(default)}))") } | ||
parameter.default.orNull()?.also { default -> rust(".or_else(||Some(${value(default)}))") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: space
parameter.default.orNull()?.also { default -> rust(".or_else(||Some(${value(default)}))") } | |
parameter.default.orNull()?.also { default -> rust(".or_else(|| Some(${value(default)}))") } |
@@ -255,10 +255,11 @@ internal class EndpointParamsGenerator(private val parameters: Parameters) { | |||
"ParamsError" to paramsError(), | |||
) { | |||
val params = writable { | |||
Attribute.Custom("allow(clippy::unnecessary_lazy_evaluations)").render(this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when it's a boolean value, the generated code isn't a function invocation
val node = this | ||
return writable { | ||
when (node) { | ||
is StringNode -> rust("Some(${node.value.dq()}.to_string())") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the fix? I fail to see it 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an unrelated refactoring
ce27b3d
to
4e83dd5
Compare
A new generated diff is ready to view.
A new doc preview is ready to view. |
Motivation and Context
String builtIn parameters resulted in a compilation error
Description
Fix EP2 bug with builtIn resolution
Testing
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.