mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-07 05:47:36 +00:00
use ALIGN for Push::alignment in struct types (#8398)
* use ALIGN for Push::alignment in struct types * regenerate and add a test for struct alignment
This commit is contained in:
committed by
GitHub
parent
807adb73b2
commit
49061f8c7c
@@ -2703,6 +2703,10 @@ class RustGenerator : public BaseGenerator {
|
||||
"{{STRUCT_TY}} as *const u8, Self::size());";
|
||||
code_ += " dst.copy_from_slice(src);";
|
||||
code_ += " }";
|
||||
code_ += " #[inline]";
|
||||
code_ += " fn alignment() -> flatbuffers::PushAlignment {";
|
||||
code_ += " flatbuffers::PushAlignment::new({{ALIGN}})";
|
||||
code_ += " }";
|
||||
code_ += "}";
|
||||
code_ += "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user