Fix typo in bevy_reflect README (#8281)

# Objective

Fix typo in bevy_reflect README: `MyType` is a struct and not a trait,
so `&dyn MyType` is incorrect.

## Solution

Replace `&dyn MyType` with `&dyn DoThing`
This commit is contained in:
fren_gor 2023-04-01 05:01:44 +02:00 committed by GitHub
parent ae39b07d26
commit 253db50c63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -153,8 +153,8 @@ let my_trait: &dyn DoThing = reflect_do_thing.get(&*reflect_value).unwrap();
println!("{}", my_trait.do_thing());
// This works because the #[reflect(MyTrait)] we put on MyType informed the Reflect derive to insert a new instance
// of ReflectDoThing into MyType's registration. The instance knows how to cast &dyn Reflect to &dyn MyType, because it
// knows that &dyn Reflect should first be downcasted to &MyType, which can then be safely casted to &dyn MyType
// of ReflectDoThing into MyType's registration. The instance knows how to cast &dyn Reflect to &dyn DoThing, because it
// knows that &dyn Reflect should first be downcasted to &MyType, which can then be safely casted to &dyn DoThing
```
## Why make this?