Skip to content

Commit

Permalink
Rust: revert escaping of unknown encoding literal
Browse files Browse the repository at this point in the history
Rust support is largely reworked in
kaitai-io#250 and
touching it here would just create conflicts.
  • Loading branch information
generalmimon committed Jul 10, 2024
1 parent 7eb8775 commit 1aac23b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()"
Expand Down

0 comments on commit 1aac23b

Please sign in to comment.