Skip to content

Commit

Permalink
bevy_reflect: Add FromReflect to the prelude (bevyengine#5720)
Browse files Browse the repository at this point in the history
# Objective

`FromReflect` is a commonly used component to the Reflect API. It's required as a bound for reflecting things like `Vec<T>` and `HashMap<K, V>` and is generally useful (if not necessary) to derive on most structs or enums.

Currently, however, it is not exported in `bevy_reflect`'s prelude. This means a module that uses `bevy_reflect` might have the following two lines:

```rust
use bevy_reflect::prelude::*;
use bevy_reflect::FromReflect;
```

Additionally, users of the full engine might need to put:

```rust
use bevy::prelude::*;
use bevy::reflect::FromReflect;
```

## Solution

Add `FromReflect` to the prelude of `bevy_reflect`.

---

## Changelog

- Added `FromReflect` to the prelude of `bevy_reflect`
  • Loading branch information
MrGVSV authored and maccesch committed Sep 28, 2022
1 parent 2cbdacb commit 856adca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/lib.rs
Expand Up @@ -35,7 +35,7 @@ pub mod prelude {
pub use crate::std_traits::*;
#[doc(hidden)]
pub use crate::{
reflect_trait, GetField, GetTupleStructField, Reflect, ReflectDeserialize,
reflect_trait, FromReflect, GetField, GetTupleStructField, Reflect, ReflectDeserialize,
ReflectSerialize, Struct, TupleStruct,
};
}
Expand Down

0 comments on commit 856adca

Please sign in to comment.