Skip to content

Commit 8139022

Browse files
committed
Change bevy_core::Name to implement Deref<Target = str> (#3681)
# Objective Fixes #3613 [Link to issue](#3613) ## Solution Changed the Deref Target to `str` and changed the `deref()` function body so that a `&str` is returned by using `as_ref() `.
1 parent e16ba80 commit 8139022

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_core/src/name.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ impl Ord for Name {
107107
}
108108

109109
impl Deref for Name {
110-
type Target = Cow<'static, str>;
110+
type Target = str;
111111

112112
fn deref(&self) -> &Self::Target {
113-
&self.name
113+
self.name.as_ref()
114114
}
115115
}

0 commit comments

Comments
 (0)