Fix custom derive when using a where clause (#853)

When injecting the users where clause we need to ensure a comma is
inserted between the users where clause and ours.
This commit is contained in:
Dan Robertson
2019-01-15 16:00:56 +00:00
committed by Pierre Krieger
parent 2b4d9786ac
commit 69abfbb18e
2 changed files with 22 additions and 1 deletions

View File

@ -112,7 +112,7 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> TokenStream {
additional.push(quote!{#substream_generic: ::libp2p::tokio_io::AsyncWrite});
if let Some(where_clause) = where_clause {
Some(quote!{#where_clause #(#additional),*})
Some(quote!{#where_clause, #(#additional),*})
} else {
Some(quote!{where #(#additional),*})
}