Skip to content

Commit

Permalink
TypeUuid derive correctly propogating generics
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSWard committed Apr 29, 2021
1 parent 3ee6094 commit 778d00f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/bevy_reflect/bevy_reflect_derive/src/type_uuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub fn type_uuid_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStre

// Build the trait implementation
let name = &ast.ident;
let (impl_generics, type_generics, where_clause) = &ast.generics.split_for_impl();

let mut uuid = None;
for attribute in ast.attrs.iter().filter_map(|attr| attr.parse_meta().ok()) {
Expand Down Expand Up @@ -53,7 +54,7 @@ pub fn type_uuid_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStre
.map(|byte_str| syn::parse_str::<LitInt>(&byte_str).unwrap());

let gen = quote! {
impl #bevy_reflect_path::TypeUuid for #name {
impl #impl_generics #bevy_reflect_path::TypeUuid for #name #type_generics #where_clause {
const TYPE_UUID: #bevy_reflect_path::Uuid = #bevy_reflect_path::Uuid::from_bytes([
#( #bytes ),*
]);
Expand Down

0 comments on commit 778d00f

Please sign in to comment.