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

@@ -194,7 +194,7 @@ bool IsOptionalToBuilder(const FieldDef &field) {
bool GenerateRustModuleRootFile(const Parser &parser,
const std::string &output_dir) {
if (parser.opts.one_file) {
if (!parser.opts.rust_module_root_file) {
// Don't generate a root file when generating one file. This isn't an error
// so return true.
return true;
@@ -371,7 +371,7 @@ class RustGenerator : public BaseGenerator {
}
bool generate() {
if (parser_.opts.one_file) {
if (!parser_.opts.rust_module_root_file) {
return GenerateOneFile();
} else {
return GenerateIndividualFiles();