From f80f73c44e5212ca01f84d147ba46adf9e6d60ff Mon Sep 17 00:00:00 2001 From: Jocelyn Kevorkian Date: Sun, 5 Apr 2020 14:19:34 +0200 Subject: [PATCH 1/2] Add import list to RustTranslator --- .../kaitai/struct/testtranslator/specgenerators/RustSG.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/RustSG.scala b/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/RustSG.scala index 560f93c76..deb40602e 100644 --- a/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/RustSG.scala +++ b/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/RustSG.scala @@ -10,7 +10,8 @@ import _root_.io.kaitai.struct.translators.RustTranslator class RustSG(spec: TestSpec, provider: ClassTypeProvider) extends BaseGenerator(spec) { val className = RustCompiler.type2class(spec.id) - val translator = new RustTranslator(provider, RuntimeConfig()) + val importList = new CppImportList + val translator = new RustTranslator(provider, importList, RuntimeConfig()) override def fileName(name: String): String = s"test_$name.rs" From c73b52c1982f91733b4dfc8b4419b4c9c9842136 Mon Sep 17 00:00:00 2001 From: Jocelyn Kevorkian Date: Mon, 6 Apr 2020 19:31:53 +0200 Subject: [PATCH 2/2] Correction on previous commit --- .../io/kaitai/struct/testtranslator/specgenerators/RustSG.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/RustSG.scala b/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/RustSG.scala index deb40602e..59eb7528a 100644 --- a/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/RustSG.scala +++ b/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/RustSG.scala @@ -10,7 +10,6 @@ import _root_.io.kaitai.struct.translators.RustTranslator class RustSG(spec: TestSpec, provider: ClassTypeProvider) extends BaseGenerator(spec) { val className = RustCompiler.type2class(spec.id) - val importList = new CppImportList val translator = new RustTranslator(provider, importList, RuntimeConfig()) override def fileName(name: String): String = s"test_$name.rs"