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()"