Change bevy_core::Name to implement Deref<Target = str> (#3681)

# Objective
Fixes #3613
[Link to issue](https://github.com/bevyengine/bevy/issues/3613)

## Solution
Changed the Deref Target to `str` and changed the `deref()` function body so that a `&str` is returned by using `as_ref() `.
This commit is contained in:
Chris J G 2022-01-17 21:30:17 +00:00
parent e16ba80bd2
commit 8139022ecd

View file

@ -107,9 +107,9 @@ impl Ord for Name {
}
impl Deref for Name {
type Target = Cow<'static, str>;
type Target = str;
fn deref(&self) -> &Self::Target {
&self.name
self.name.as_ref()
}
}