mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 14:08:32 +00:00
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:
parent
e16ba80bd2
commit
8139022ecd
1 changed files with 2 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue