From 1aac23b27b169e6ff7be41e94ba9875ccc0861fb Mon Sep 17 00:00:00 2001 From: Petr Pucil Date: Wed, 10 Jul 2024 23:45:53 +0200 Subject: [PATCH] Rust: revert escaping of unknown encoding literal Rust support is largely reworked in https://github.com/kaitai-io/kaitai_struct_compiler/pull/250 and touching it here would just create conflicts. --- .../scala/io/kaitai/struct/translators/RustTranslator.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/src/main/scala/io/kaitai/struct/translators/RustTranslator.scala b/shared/src/main/scala/io/kaitai/struct/translators/RustTranslator.scala index 6f77cc4ce..af1c5efd6 100644 --- a/shared/src/main/scala/io/kaitai/struct/translators/RustTranslator.scala +++ b/shared/src/main/scala/io/kaitai/struct/translators/RustTranslator.scala @@ -81,7 +81,7 @@ class RustTranslator(provider: TypeProvider, config: RuntimeConfig) extends Base case "ASCII" => s"String::from_utf8_lossy($bytesExpr)" case _ => - s"panic!(\"Unimplemented encoding for bytesToStr: {}\", \"${doStringLiteral(encoding)}\")" + "panic!(\"Unimplemented encoding for bytesToStr: {}\", \"" + encoding + "\")" } override def bytesLength(b: Ast.expr): String = s"${translate(b, METHOD_PRECEDENCE)}.len()"