From 75056c6a780529692e1b44e18402352205f9e1f6 Mon Sep 17 00:00:00 2001 From: Matteo Bigoi <1781140+crisidev@users.noreply.github.com> Date: Fri, 18 Mar 2022 22:23:05 +0000 Subject: [PATCH] Fix bug where where format argument is not a literal string (#1266) --- .../rust/codegen/smithy/protocols/parse/JsonParserGenerator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/parse/JsonParserGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/parse/JsonParserGenerator.kt index d963b9684..739f0a93e 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/parse/JsonParserGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/parse/JsonParserGenerator.kt @@ -370,7 +370,7 @@ class JsonParserGenerator( if (StructureGenerator.fallibleBuilder(shape, symbolProvider)) { rustTemplate( """.map_err(|err| #{Error}::new( - #{ErrorReason}::Custom(format!({}, err).into()), None) + #{ErrorReason}::Custom(format!("{}", err).into()), None) )?""", *codegenScope ) -- GitLab