You can stop reading if you don't use the FIDL Rust bindings.
As of
fxr/844716, FIDL tables implement the
Default trait. Instead of constructing tables like this:
// "Struct update" style
let my_table = MyTable {
foo: Some(42),
..MyTable::EMPTY
};
// Assignment style
let my_table = MyTable::EMPTY;
my_table.foo = Some(42);
You should now construct them like this:
// "Struct update" style
let my_table = MyTable {
foo: Some(42),
..Default::default()
};
// Assignment style
let my_table = MyTable::default();
my_table.foo = Some(42);
I will migrate all existing code and remove the EMPTY constant when I'm done.
See fxb/102876 if you're curious for more details.
Mitchell
..