Skip to content

Commit

Permalink
Fix typo in bevy_reflect README (#8281)
Browse files Browse the repository at this point in the history
# 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`
  • Loading branch information
frengor authored Apr 1, 2023
1 parent ae39b07 commit 253db50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_reflect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 253db50

Please sign in to comment.