-
Notifications
You must be signed in to change notification settings - Fork 197
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 commentThe 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 commentThe 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 |
||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Nit: space
Suggested change
|
||||||
if (parameter.isRequired) { | ||||||
rustTemplate( | ||||||
".ok_or_else(||#{Error}::missing(${parameter.memberName().dq()}))?", | ||||||
|
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