forked from BigfootDev/flatbuffers
[Rust] Add the Allocator trait for the builder API (#8106)
* Add an Allocator trait for FlatBufferBuilder * Update rust generated code
This commit is contained in:
@@ -115,7 +115,7 @@ impl EquipmentT {
|
||||
Self::Weapon(_) => Equipment::Weapon,
|
||||
}
|
||||
}
|
||||
pub fn pack(&self, fbb: &mut flatbuffers::FlatBufferBuilder) -> Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>> {
|
||||
pub fn pack<'b, A: flatbuffers::Allocator + 'b>(&self, fbb: &mut flatbuffers::FlatBufferBuilder<'b, A>) -> Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>> {
|
||||
match self {
|
||||
Self::NONE => None,
|
||||
Self::Weapon(v) => Some(v.pack(fbb).as_union_value()),
|
||||
|
||||
Reference in New Issue
Block a user