mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-16 09:12:22 +00:00
fix(flatbuffers): use manual impl Default for struct object types (#8947)
* fix(flatbuffers): use manual impl Default for struct object types * fix: handle bool and float zero literals in struct object Default impl * fix: regenerate all test bindings with generate_code.py * fix: data type check on swift build * fix: test large array on struct and enum
This commit is contained in:
@@ -245,7 +245,7 @@ impl<'a> ArrayStruct {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Default)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct ArrayStructT {
|
||||
pub a: f32,
|
||||
pub b: [i32; 15],
|
||||
@@ -254,6 +254,18 @@ pub struct ArrayStructT {
|
||||
pub e: i32,
|
||||
pub f: [i64; 2],
|
||||
}
|
||||
impl Default for ArrayStructT {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
a: 0.0,
|
||||
b: [0; 15],
|
||||
c: 0,
|
||||
d: ::flatbuffers::array_init(|_| Default::default()),
|
||||
e: 0,
|
||||
f: [0; 2],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ArrayStructT {
|
||||
pub fn pack(&self) -> ArrayStruct {
|
||||
|
||||
Reference in New Issue
Block a user