diff --git a/redwood-tooling-codegen/src/main/kotlin/app/cash/redwood/tooling/codegen/protocolGuestGeneration.kt b/redwood-tooling-codegen/src/main/kotlin/app/cash/redwood/tooling/codegen/protocolGuestGeneration.kt index 1cc1c18b51..5160ba3b84 100644 --- a/redwood-tooling-codegen/src/main/kotlin/app/cash/redwood/tooling/codegen/protocolGuestGeneration.kt +++ b/redwood-tooling-codegen/src/main/kotlin/app/cash/redwood/tooling/codegen/protocolGuestGeneration.kt @@ -207,7 +207,7 @@ internal class ProtocolButton( } override fun text(text: String?) { - guestAdapter.appendPropertyChange(this.id, PropertyTag(1), guestAdapter.json.encodeToJsonElement(serializer_0, text)) + this.guestAdapter.appendPropertyChange(this.id, PropertyTag(1), serializer_0, text) } override fun onClick(onClick: (() -> Unit)?) { @@ -494,11 +494,6 @@ internal object GrowSerializer : KSerializer { override fun deserialize(decoder: Decoder): Grow { throw AssertionError() } - - fun encode(json: Json, value: Grow): ModifierElement { - val element = json.encodeToJsonElement(this, value) - return ModifierElement(ModifierTag(3), element) - } } */ internal fun generateProtocolModifierSerializers( @@ -672,20 +667,6 @@ internal fun generateProtocolModifierSerializers( .addStatement("throw %T()", Stdlib.AssertionError) .build(), ) - .addFunction( - FunSpec.builder("encode") - .addParameter("json", KotlinxSerialization.Json) - .addParameter("value", modifierType) - .returns(Protocol.ModifierElement) - .addStatement("val element = json.encodeToJsonElement(this, value)") - .addStatement( - "return %T(%T(%L), element)", - Protocol.ModifierElement, - Protocol.ModifierTag, - modifier.tag, - ) - .build(), - ) .build(), ) }