Optional Scalars support for Rust (#6034)

* First draft of rust optionals

* Code cleanup around ftBool and ftVectorOfBool

* Tests for Rust optional scalars

* test bools too

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2020-07-23 16:30:27 -07:00
committed by GitHub
parent c8fa0afdfc
commit 043b52bd4a
12 changed files with 626 additions and 59 deletions

View File

@@ -3457,9 +3457,11 @@ void NullableScalarsTest() {
// Test if nullable scalars are allowed for each language.
const int kNumLanguages = 17;
const auto supported = flatbuffers::IDLOptions::kRust;
for (int lang=0; lang<kNumLanguages; lang++) {
flatbuffers::IDLOptions opts;
opts.lang_to_generate |= 1 << lang;
if (opts.lang_to_generate & supported) continue;
for (auto schema = schemas.begin(); schema < schemas.end(); schema++) {
const bool has_null = schema->find("null") != std::string::npos;
flatbuffers::Parser parser(opts);