swarm-derive/: Add where clause of behaviour to generated out event (#2819)

When generating the `OutEvent` for a `NetworkBehaviour`, add the `where` clause of the
`NetworkBehaviour` `struct` to the generated `enum`.
This commit is contained in:
Max Inden
2022-08-17 06:43:47 +02:00
committed by GitHub
parent 8dc0188a1d
commit 67266c6a66
2 changed files with 17 additions and 2 deletions

View File

@ -159,7 +159,9 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> TokenStream {
let visibility = &ast.vis;
Some(quote! {
#visibility enum #name #impl_generics {
#visibility enum #name #impl_generics
#where_clause
{
#(#fields),*
}
})