mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 19:12:01 +00:00
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:
@@ -1605,7 +1605,7 @@ class RustGenerator : public BaseGenerator {
|
|||||||
code_.SetValue("OFFSET_VALUE", NumToString(field.value.offset));
|
code_.SetValue("OFFSET_VALUE", NumToString(field.value.offset));
|
||||||
code_.SetValue("FIELD", namer_.Field(field));
|
code_.SetValue("FIELD", namer_.Field(field));
|
||||||
code_.SetValue("BLDR_DEF_VAL", GetDefaultValue(field, kBuilder));
|
code_.SetValue("BLDR_DEF_VAL", GetDefaultValue(field, kBuilder));
|
||||||
code_.SetValue("DISCRIMINANT", namer_.Method(field) + "_type");
|
code_.SetValue("DISCRIMINANT", namer_.Field(field) + "_type");
|
||||||
code_.IncrementIdentLevel();
|
code_.IncrementIdentLevel();
|
||||||
cb(field);
|
cb(field);
|
||||||
code_.DecrementIdentLevel();
|
code_.DecrementIdentLevel();
|
||||||
|
|||||||
Reference in New Issue
Block a user