Skip to content

Commit 7676619

Browse files
joseph-giogeieredgar
authored andcommitted
remove an unnecessary special-case
1 parent 4083b7c commit 7676619

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

crates/bevy_macro_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ pub fn derive_label(input: syn::DeriveInput, trait_path: &syn::Path) -> TokenStr
236236
}
237237

238238
fn dyn_hash(&self, mut state: &mut dyn ::std::hash::Hasher) {
239-
let ty_id = #trait_path::inner_type_id(self);
239+
let ty_id = ::std::any::TypeId::of::<Self>();
240240
::std::hash::Hash::hash(&ty_id, &mut state);
241241
::std::hash::Hash::hash(self, &mut state);
242242
}

crates/bevy_utils/src/label.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,6 @@ macro_rules! define_label {
8282

8383
$(#[$label_attr])*
8484
pub trait $label_trait_name: 'static + Send + Sync + ::std::fmt::Debug {
85-
/// Return's the [TypeId] of this label, or the the ID of the
86-
/// wrappped label type for `Box<dyn
87-
#[doc = stringify!($label_trait_name)]
88-
/// >`
89-
///
90-
/// [TypeId]: std::any::TypeId
91-
fn inner_type_id(&self) -> ::std::any::TypeId {
92-
std::any::TypeId::of::<Self>()
93-
}
94-
9585
/// Clones this `
9686
#[doc = stringify!($label_trait_name)]
9787
/// `
@@ -149,10 +139,6 @@ macro_rules! define_label {
149139
}
150140

151141
impl $label_trait_name for ::bevy_utils::intern::Interned<dyn $label_trait_name> {
152-
fn inner_type_id(&self) -> ::std::any::TypeId {
153-
(**self).inner_type_id()
154-
}
155-
156142
fn dyn_clone(&self) -> Box<dyn $label_trait_name> {
157143
(**self).dyn_clone()
158144
}

0 commit comments

Comments
 (0)