Rust structz (#6539)

* Rust structz

* struct of structs test

* swift tmp variables

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2021-03-29 19:56:45 -04:00
committed by GitHub
parent 1c26d2a1a0
commit 4133a39df8
25 changed files with 1681 additions and 564 deletions

View File

@@ -935,8 +935,8 @@ class SwiftGenerator : public BaseGenerator {
auto type = GenType(field.value.type);
code_.SetValue("VALUENAME", name);
if (IsStruct(field.value.type)) {
code_ += "var _v = _t.{{VALUENAME}}";
code_ += "_{{VALUENAME}} = _v.unpack()";
code_ += "var _v{{VALUENAME}} = _t.{{VALUENAME}}";
code_ += "_{{VALUENAME}} = _v{{VALUENAME}}.unpack()";
continue;
}
std::string is_enum = IsEnum(field.value.type) ? ".value" : "";