Skip to content

Commit b4be682

Browse files
committed
simplify interner declaration
1 parent 6341f2a commit b4be682

File tree

1 file changed

+4
-6
lines changed
  • crates/bevy_macro_utils/src

1 file changed

+4
-6
lines changed

crates/bevy_macro_utils/src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,11 @@ fn derive_hashed_label(
350350
// all of the labels for any generic type must be interned in the same global.
351351
let is_generic = !input.generics.params.is_empty();
352352

353-
let interner_generics = if !is_generic {
354-
quote! { <u64, #ident> }
353+
let interner_type = if !is_generic {
354+
quote! { #interner_type_path <u64, #ident> }
355355
} else {
356356
let boxed_ty = quote! { ::std::boxed::Box::<dyn #downcast_debug_path + ::std::marker::Send + ::std::marker::Sync> };
357-
quote! { <(u64, ::std::any::TypeId), #boxed_ty> }
357+
quote! { #interner_type_path <(u64, ::std::any::TypeId), #boxed_ty> }
358358
};
359359

360360
let mut clone_expr = quote! { ::std::clone::Clone::clone(self) };
@@ -378,9 +378,7 @@ fn derive_hashed_label(
378378
}
379379

380380
quote! {
381-
static #interner_ident
382-
: #interner_type_path #interner_generics
383-
= #interner_type_path::new();
381+
static #interner_ident : #interner_type = #interner_type_path::new();
384382

385383
impl #impl_generics #trait_path for #ident #ty_generics #where_clause {
386384
#[inline]

0 commit comments

Comments
 (0)