bevy/crates/bevy_reflect/src
davier 55402bdf2e
Fix debug printing for dynamic types (#10740)
# Objective

Printing `DynamicStruct` with a debug format does not show the contained
type anymore. For instance, in `examples/reflection/reflection.rs`,
adding `dbg!(&reflect_value);` to line 96 will print:
```rust
[examples/reflection/reflection.rs:96] &reflect_value = DynamicStruct(bevy_reflect::DynamicStruct {
    a: 4,
    nested: DynamicStruct(bevy_reflect::DynamicStruct {
        b: 8,
    }),
})
```

## Solution

Show the represented type instead (`reflection::Foo` and
`reflection::Bar` in this case):
```rust
[examples/reflection/reflection.rs:96] &reflect_value = DynamicStruct(reflection::Foo {
    a: 4,
    nested: DynamicStruct(reflection::Bar {
        b: 8,
    }),
})
```

---------

Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
2023-12-12 19:44:43 +00:00
..
enums Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
impls Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
path Fix some nightly warnings (#9672) 2023-09-02 18:35:06 +00:00
serde Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
array.rs Fix debug printing for dynamic types (#10740) 2023-12-12 19:44:43 +00:00
fields.rs reflect: TypePath part 2 (#8768) 2023-10-09 19:33:03 +00:00
from_reflect.rs reflect: TypePath part 2 (#8768) 2023-10-09 19:33:03 +00:00
lib.rs Fix debug printing for dynamic types (#10740) 2023-12-12 19:44:43 +00:00
list.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
map.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
reflect.rs delete methods deprecated in 0.12 (#10693) 2023-11-24 16:15:47 +00:00
std_traits.rs
struct_trait.rs Fix debug printing for dynamic types (#10740) 2023-12-12 19:44:43 +00:00
tuple_struct.rs Fix debug printing for dynamic types (#10740) 2023-12-12 19:44:43 +00:00
tuple.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
type_info.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
type_path.rs bevy_reflect: Fix dynamic type serialization (#10103) 2023-10-16 23:31:16 +00:00
type_registry.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
type_uuid_impl.rs implement TypeUuid for primitives and fix multiple-parameter generics having the same TypeUuid (#6633) 2023-02-16 17:09:44 +00:00
type_uuid.rs bevy_utils: Export generate_composite_uuid utility function (#10496) 2023-11-25 23:21:35 +00:00
utility.rs Removed once_cell (#10079) 2023-10-12 10:20:07 +00:00