mirror of
https://github.com/bevyengine/bevy
synced 2024-12-20 18:13:10 +00:00
6d25545c51
# Objective - Make `Result<T, E>` implement Reflect such that it is an Enum rather than a Value - Fixes #13178 ## Solution - Use the correct macro ## Testing - Did you test these changes? I tried it out locally, and it does what it says on the tin. Not sure how to test it in context of the crate? --- ## Changelog ### Changed - Result now uses `ReflectKind::Enum` rather than `ReflectKind::Value`, allowing for inspection of its constituents ## Migration Guide `Result<T, E>` has had its `Reflect` implementation changed to align it with `Option<T>` and its intended semantics: A carrier of either an `Ok` or `Err` value, and the ability to access it. To achieve this it is no longer a `ReflectKind::Value` but rather a `ReflectKind::Enum` and as such carries these changes with it: For `Result<T, E>` - Both `T` and `E` no longer require to be `Clone` and now require to be `FromReflect` - `<Result<T, E> as Reflect>::reflect_*` now returns a `ReflectKind::Enum`, so any code that previously relied on it being a `Value` kind will have to be adapted. - `Result<T, E>` now implements `Enum` Since the migration is highly dependent on the previous usage, no automatic upgrade path can be given. Signed-off-by: Marcel Müller <neikos@neikos.email> |
||
---|---|---|
.. | ||
math | ||
glam.rs | ||
petgraph.rs | ||
smallvec.rs | ||
smol_str.rs | ||
std.rs | ||
uuid.rs |