mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-27 11:12:19 +00:00
[Rust] Ensure unions are referenced with the correct path (#6422)
* Add codegen test for namespaced unions * [Rust] Handle cross-namespace union use * [Rust] Test namespace handling * [Rust] Drop trailing whitespace in codegen * [Rust] Set flags in generate_code.bat to match .sh * [C#] Add additional namespace test file
This commit is contained in:
@@ -212,7 +212,7 @@ impl Default for EquipmentT {
|
||||
}
|
||||
}
|
||||
impl EquipmentT {
|
||||
fn equipment_type(&self) -> Equipment {
|
||||
pub fn equipment_type(&self) -> Equipment {
|
||||
match self {
|
||||
Self::NONE => Equipment::NONE,
|
||||
Self::Weapon(_) => Equipment::Weapon,
|
||||
@@ -689,7 +689,7 @@ impl std::fmt::Debug for Monster<'_> {
|
||||
ds.field("equipped", &"InvalidFlatbuffer: Union discriminant does not match value.")
|
||||
}
|
||||
},
|
||||
_ => {
|
||||
_ => {
|
||||
let x: Option<()> = None;
|
||||
ds.field("equipped", &x)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user