Skip to content

Commit

Permalink
Fix #773
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaasJG committed Apr 22, 2024
1 parent 708c3ac commit 1ae55a7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions specs-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern crate syn;
use proc_macro::TokenStream;
use syn::{
parse::{Parse, ParseStream, Result},
DeriveInput, Path,
DeriveInput, Path, PathArguments,
};

mod impl_saveload;
Expand Down Expand Up @@ -68,9 +68,14 @@ fn impl_component(ast: &DeriveInput) -> proc_macro2::TokenStream {
})
.unwrap_or_else(|| parse_quote!(DenseVecStorage));

let additional_generics = match storage.segments.last().unwrap().arguments {
PathArguments::AngleBracketed(_) => quote!(),
_ => quote!(\<Self>)
};

quote! {
impl #impl_generics Component for #name #ty_generics #where_clause {
type Storage = #storage<Self>;
type Storage = #storage #additional_generics;
}
}
}
Expand Down

0 comments on commit 1ae55a7

Please sign in to comment.