Use keep case for Rust union discriminant type. (#7321)

Fixes #7320.

I realize that Rust doesn't really follow the Namer convention, since
it uses Field case for methods... that's a future problem.

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2022-05-23 12:53:00 -07:00
committed by GitHub
parent 9e8c758f54
commit 9aa08a429e

View File

@@ -1605,7 +1605,7 @@ class RustGenerator : public BaseGenerator {
code_.SetValue("OFFSET_VALUE", NumToString(field.value.offset));
code_.SetValue("FIELD", namer_.Field(field));
code_.SetValue("BLDR_DEF_VAL", GetDefaultValue(field, kBuilder));
code_.SetValue("DISCRIMINANT", namer_.Method(field) + "_type");
code_.SetValue("DISCRIMINANT", namer_.Field(field) + "_type");
code_.IncrementIdentLevel();
cb(field);
code_.DecrementIdentLevel();