Skip to content

Commit

Permalink
hide CodeBlock completely
Browse files Browse the repository at this point in the history
  • Loading branch information
seniorjoinu committed Sep 16, 2020
1 parent 2aa2187 commit b08c0de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/senior/joinu/candid/transpile/Complex.kt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fun transpileRecord(
val poetizeFunc = FunSpec.builder("poetize")
.addModifiers(KModifier.OVERRIDE)
.returns(String::class)
.addStatement("return %T.of(%S, ${serName.simpleName}::class).toString()", Code::class, "%T")
.addStatement("return %T.of(%S, ${serName.simpleName}::class)", Code::class, "%T")
serBuilder.addFunction(poetizeFunc.build())

context.currentSpec.addType(recordBuilder.build())
Expand Down Expand Up @@ -257,7 +257,7 @@ fun transpileVariant(
val poetizeFunc = FunSpec.builder("poetize")
.addModifiers(KModifier.OVERRIDE)
.returns(String::class)
.addStatement("return %T.of(%S, ${variantSuperValueSerName}::class).toString()", Code::class, "%T")
.addStatement("return %T.of(%S, ${variantSuperValueSerName}::class)", Code::class, "%T")
variantSuperValueSerBuilder.addFunction(poetizeFunc.build())

context.currentSpec.addType(variantSuperBuilder.build())
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/senior/joinu/candid/utils/Common.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.util.*
typealias CodeBlock = CodeBlock

object Code {
fun of(format: String, vararg args: Any?) = CodeBlock.of(format, args)
fun of(format: String, vararg args: Any?) = CodeBlock.of(format, args).toString()
}

fun idlHash(id: String): Int {
Expand Down

0 comments on commit b08c0de

Please sign in to comment.