Change Rust generated file defaults (#7101)

* Change Rust generated file defaults

After #6731, flatc changed its default behavior
for generating rust code to fix some importing issues.
This was a breaking change which invlidated the patch release,
`flatc 2.0.5` (#7081). This PR reverses the default so we can
release a patch update. However, does break Rust users who work at
HEAD.

* Bump flatc patch version (2.0.6)

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2022-02-15 11:48:42 -05:00
committed by GitHub
parent 3413c33004
commit 615616cb55
26 changed files with 35 additions and 26 deletions

View File

@@ -185,6 +185,8 @@ const static FlatCOption options[] = {
{ "", "reflect-names", "", "Add minimal type/name reflection." },
{ "", "rust-serialize", "",
"Implement serde::Serialize on generated Rust types." },
{"", "rust-module-root-file", "",
"Generate rust code in individual files with a module root file."},
{ "", "root-type", "T", "Select or override the default root_type." },
{ "", "require-explicit-ids", "",
"When parsing schemas, require explicit ids (id: x)." },
@@ -503,6 +505,8 @@ int FlatCompiler::Compile(int argc, const char **argv) {
opts.mini_reflect = IDLOptions::kTypesAndNames;
} else if (arg == "--rust-serialize") {
opts.rust_serialize = true;
} else if (arg == "--rust-module-root-file") {
opts.rust_module_root_file = true;
} else if (arg == "--require-explicit-ids") {
opts.require_explicit_ids = true;
} else if (arg == "--root-type") {