Skip to content

Commit 253db50

Browse files
authored
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`
1 parent ae39b07 commit 253db50

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_reflect/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ let my_trait: &dyn DoThing = reflect_do_thing.get(&*reflect_value).unwrap();
153153
println!("{}", my_trait.do_thing());
154154

155155
// This works because the #[reflect(MyTrait)] we put on MyType informed the Reflect derive to insert a new instance
156-
// of ReflectDoThing into MyType's registration. The instance knows how to cast &dyn Reflect to &dyn MyType, because it
157-
// knows that &dyn Reflect should first be downcasted to &MyType, which can then be safely casted to &dyn MyType
156+
// of ReflectDoThing into MyType's registration. The instance knows how to cast &dyn Reflect to &dyn DoThing, because it
157+
// knows that &dyn Reflect should first be downcasted to &MyType, which can then be safely casted to &dyn DoThing
158158
```
159159

160160
## Why make this?

0 commit comments

Comments
 (0)